]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: remove the open classes if no visible reveal exists after destroying one
authorDaniel Ruf <daniel@daniel-ruf.de>
Sun, 11 Mar 2018 22:35:53 +0000 (23:35 +0100)
committerDaniel Ruf <daniel@daniel-ruf.de>
Sun, 11 Mar 2018 22:35:53 +0000 (23:35 +0100)
js/foundation.reveal.js

index 32c5d49fc2876f4a1434cd785c8cf77f753d636a..5f95eef4feb54de88b08eac5c959a4f86e066a81 100644 (file)
@@ -278,6 +278,11 @@ class Reveal extends Plugin {
       $('html').addClass('is-reveal-open');
     }
 
+    function removeRevealOpenClasses() {
+
+      $('html').removeClass('is-reveal-open');
+    }
+
     // Motion UI method of reveal
     if (this.options.animationIn) {
       function afterAnimation(){
@@ -409,7 +414,7 @@ class Reveal extends Plugin {
       var scrollTop = parseInt($("html").css("top"));
 
       if ($('.reveal:visible').length  === 0) {
-        $('html').removeClass('is-reveal-open');
+        removeRevealOpenClasses();
       }
 
       Keyboard.releaseFocus(_this.$element);
@@ -469,6 +474,10 @@ class Reveal extends Plugin {
     this.$element.hide().off();
     this.$anchor.off('.zf');
     $(window).off(`.zf.reveal:${this.id}`);
+
+    if ($('.reveal:visible').length  === 0) {
+      removeRevealOpenClasses();
+    }
   };
 }