-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor LifecycleEditor to make it work with htmx
Htmx imports external javascript sources introduced in htmx responses, but the run order is not like normal web pages, and thus previously we got an error: Uncaught TypeError: RT.NewLifecycleEditor is not a constructor Besides, because of js class declaration, if lifecycleui-model.js is imported multiple times, we would get: Identifier 'LifecycleModel' has already been declared This commit makes the following changes to make it work with htmx: * Merge LifecyleModel into the anonymous js class saved in RT.NewLifecycleEditor Via js class expression instead of a standard class declaration, we don't need to worry about the code being imported multiple times. * Move editor initialization code from inline to util.js for consistency * Initialize only when editor is available
- Loading branch information
Showing
6 changed files
with
833 additions
and
840 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.