Эх сурвалжийг харах

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

Vijayakrishnan 4 жил өмнө
parent
commit
21bb8c8d80

+ 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');