Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable prompt dialog for the home page (#141)
Currently, whenever one tries to navigate away from an appmode app, (e.g. by clicking a URL link, or closing a tab), a confirmation dialog always pops up, even without any real interaction with the page. This is especially annoying for the home app. The confirmation dialog comes from the jupyter notebook, because Appmode always copies the notebook and executes it, which leaves it in an "unsaved" state from the jupyter notebook point of view. Here we simply override the 'onbefereunload' event handler that is defined. For now this fix is only applied to the home page. If there are no issues, we could fix this globally by implementing the fix directly in the Appmode itself, specifically here: https://github.com/oschuett/appmode/blob/3998dc1a6d61f06581fe818351e70860c26c442a/appmode/static/main.js#L136 Note that in the past, the `onbeforeunload` event used to be overrided in Appmode, but later the handler was moved to the `unload` event, which exposed the confirmation dialog. See oschuett/appmode@8665aa6 The unload event handler in Appmode takes care of the cleanup, i.e. shutting down the kernel. Since we're modifying a different event, we should be safe (and I have tested that sessions get cleaned properly). See #133 for further technical details and discussion.
- Loading branch information