Sfoglia il codice sorgente

Fix shortcut dialog toggling

j8
Ilya Daynatovich 8 anni fa
parent
commit
d06aef511f
2 ha cambiato i file con 19 aggiunte e 5 eliminazioni
  1. 10
    5
      modules/UI/UI.js
  2. 9
    0
      modules/UI/util/MessageHandler.js

+ 10
- 5
modules/UI/UI.js Vedi File

@@ -1491,12 +1491,17 @@ UI.hideUserMediaPermissionsGuidanceOverlay = function () {
1491 1491
  * Shows or hides the keyboard shortcuts panel, depending on the current state.'
1492 1492
  */
1493 1493
 UI.toggleKeyboardShortcutsPanel = function() {
1494
-    let titleKey = 'keyboardShortcuts.keyboardShortcuts';
1495
-    let title = APP.translation.translateString(titleKey);
1496
-    let msg = $('#keyboard-shortcuts').html();
1497
-    let buttons = { Close: true };
1494
+    if (!messageHandler.isDialogOpened()) {
1495
+        let titleKey = 'keyboardShortcuts.keyboardShortcuts';
1496
+        let title = APP.translation.translateString(titleKey);
1497
+        let msg = $('#keyboard-shortcuts').html();
1498
+        let buttons = { Close: true };
1499
+
1500
+        messageHandler.openDialog(title, msg, true, buttons);
1501
+    } else {
1502
+        messageHandler.closeDialog();
1503
+    }
1498 1504
 
1499
-    messageHandler.openDialog(title, msg, true, buttons);
1500 1505
 };
1501 1506
 
1502 1507
 /**

+ 9
- 0
modules/UI/util/MessageHandler.js Vedi File

@@ -373,6 +373,15 @@ var messageHandler = {
373 373
 
374 374
     enablePopups: function (enable) {
375 375
         popupEnabled = enable;
376
+    },
377
+
378
+    /**
379
+     * Returns true if dialog is opened
380
+     * false otherwise
381
+     * @returns {boolean} isOpened
382
+     */
383
+    isDialogOpened: function () {
384
+        return !!$.prompt.getCurrentStateName();
376 385
     }
377 386
 };
378 387
 

Loading…
Annulla
Salva