瀏覽代碼

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

Vijayakrishnan 4 年之前
父節點
當前提交
21bb8c8d80
共有 1 個文件被更改,包括 6 次插入0 次删除
  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');