This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
Implement modality of a JS dialog in app shell by using a new api. #268
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This requires another pull request on brackets repo that makes calls to the new api in dialogs.js to have it working. adobe/brackets#4341
A new API setModal is introduced so that Brackets can tell app shell to enforce modality when a JS modal dialog is showing. Before showing the JS dialog, we need to call this api with
true
argument; and after dismissing the dialog, we need to call it withfalse
argument.When the modality is on, all menu items will be disabled and users will not be able to click on any menu item or using its shortcuts. One exception to this on Mac is that some of the Edit menu items (Undo, Redo, Cut, Copy, Paste and Select All) will still be enabled so that users can use them in text fields in any JS dialog.
Modality is not only enforced on menus and shortcuts, but also on other UIs and shortcuts available on the window title bar. That is. X button and Alt+F4 shortcut will be disabled during the display of a JS dialog.
Although menus and commands won't be available in a JS dialog, dialog-specific shortcuts or key events will be available. For example, Cmd-D, Cmd-. and Escape key to dismiss the dialog.