Speed up key handling by adding modals.is_active().

The function modals.is_active() can see if modals are open
without having to look at the DOM.  This should make it snappier
to type in the compose box.  Even if the speedup is pretty minor,
not having to worry about jQuery slowness should make it easier
to diagnose future compose box issues.

The new function gets used in other places, too, where performance
isn't so much an issue.
This commit is contained in:
Steve Howell
2017-05-05 17:40:32 -07:00
committed by Tim Abbott
parent 3c0ef6295f
commit 742c55f514
11 changed files with 17 additions and 21 deletions

View File

@@ -504,7 +504,7 @@ function welcome() {
}
exports.start = function () {
if (ui_state.home_tab_obscured()) {
if (modals.is_active()) {
ui_util.change_tab_to('#home');
}
narrow.deactivate();