Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

RaymondLim
Copy link
Contributor

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 with false 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.

RaymondLim and others added 5 commits June 24, 2013 00:22
… global variable.

Also prevent the browser window from closing when there is a JS modal dialog showing.
Keep some edit commands enabled so that the user can use their shortcuts in a text field inside a JS dialog.
@quasado
Copy link

quasado commented Dec 9, 2013

I am curious whether this pull request will ever make it into brackets-shell repo or not?

@iwehrman
Copy link
Contributor

iwehrman commented Jan 2, 2014

I am also curious. We should discuss this in an architecture review meeting, if necessary. I really wish I could dismiss modal dialogs with the keyboard, and I think this is one route to a solution? Basic keyboard accessibility might something we consider important for a 1.0 release.

@RaymondLim
Copy link
Contributor Author

Closing for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants