Преглед на файлове

Card Details Popup, edit of Checklist, Checklistitems and Description now works

- problem is that if a inlined-form is opened within a popup, the popup
  is closed first
Martin Filser преди 3 години
родител
ревизия
5f58ede7e3
променени са 1 файла, в които са добавени 17 реда и са изтрити 13 реда
  1. 17 13
      client/lib/popup.js

+ 17 - 13
client/lib/popup.js

@@ -192,17 +192,21 @@ window.Popup = new (class {
   }
   }
 })();
 })();
 
 
-// We close a potential opened popup on any left click on the document, or go
-// one step back by pressing escape.
-const escapeActions = ['back', 'close'];
-escapeActions.forEach(actionName => {
-  EscapeActions.register(
-    `popup-${actionName}`,
-    () => Popup[actionName](),
-    () => Popup.isOpen(),
-    {
-      noClickEscapeOn: '.js-pop-over,.js-open-card-title-popup',
-      enabledOnClick: actionName === 'close',
-    },
-  );
+Meteor.startup(() => {
+  if (!Utils.isMiniScreen()) {
+    // We close a potential opened popup on any left click on the document, or go
+    // one step back by pressing escape.
+    const escapeActions = ['back', 'close'];
+    escapeActions.forEach(actionName => {
+      EscapeActions.register(
+        `popup-${actionName}`,
+        () => Popup[actionName](),
+        () => Popup.isOpen(),
+        {
+          noClickEscapeOn: '.js-pop-over,.js-open-card-title-popup',
+          enabledOnClick: actionName === 'close',
+        },
+      );
+    });
+  }
 });
 });