Quellcode durchsuchen

[close-all-with-self] support for stag-popups

Vijayakrishnan vor 4 Jahren
Ursprung
Commit
21bb8c8d80
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      public/js/stag-popup.js

+ 6 - 0
public/js/stag-popup.js

@@ -29,8 +29,14 @@ function submitStagPopup(_form) {
 function closeStagPopup() {
     if(!stagPopupsQueue.length) return false;
     let popup = stagPopupsQueue[stagPopupsQueue.length - 1];
+    let closeAll = !!popup.attr('close-all-with-self');
     popup.removeClass('show');
     stagPopupsQueue.splice(stagPopupsQueue.length - 1, 1);
+    if(closeAll) {
+        while(stagPopupsQueue.length) {
+            closeStagPopup();
+        }
+    }
     // if all closed
     if(!stagPopupsQueue.length) {
         $('html, body').removeClass('no-scroll');