Merge pull request #1024 from BeatC/shortcut-dialog-fixes

Fix shortcut dialog toggling
pull/1030/head 1370
yanas 9 years ago committed by GitHub
commit 442d2fa316
  1. 15
      modules/UI/UI.js
  2. 9
      modules/UI/util/MessageHandler.js

@ -1491,12 +1491,17 @@ UI.hideUserMediaPermissionsGuidanceOverlay = function () {
* Shows or hides the keyboard shortcuts panel, depending on the current state.'
*/
UI.toggleKeyboardShortcutsPanel = function() {
let titleKey = 'keyboardShortcuts.keyboardShortcuts';
let title = APP.translation.translateString(titleKey);
let msg = $('#keyboard-shortcuts').html();
let buttons = { Close: true };
if (!messageHandler.isDialogOpened()) {
let titleKey = 'keyboardShortcuts.keyboardShortcuts';
let title = APP.translation.translateString(titleKey);
let msg = $('#keyboard-shortcuts').html();
let buttons = { Close: true };
messageHandler.openDialog(title, msg, true, buttons);
} else {
messageHandler.closeDialog();
}
messageHandler.openDialog(title, msg, true, buttons);
};
/**

@ -373,6 +373,15 @@ var messageHandler = {
enablePopups: function (enable) {
popupEnabled = enable;
},
/**
* Returns true if dialog is opened
* false otherwise
* @returns {boolean} isOpened
*/
isDialogOpened: function () {
return !!$.prompt.getCurrentStateName();
}
};

Loading…
Cancel
Save