]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: enable and disable scroll if there is no visible reveal 11705/head
authorDaniel Ruf <daniel.ruf@ueberbit.de>
Thu, 28 Feb 2019 13:05:47 +0000 (14:05 +0100)
committerDaniel Ruf <daniel.ruf@ueberbit.de>
Thu, 28 Feb 2019 13:05:47 +0000 (14:05 +0100)
js/foundation.reveal.js

index 13ba0f11ddcbe7e542a8edbe462da9ae2c8c2136..434f9601ec411292025fa49f24a6a38b47654f8d 100644 (file)
@@ -273,7 +273,9 @@ class Reveal extends Plugin {
       this.$element.trigger('closeme.zf.reveal', this.id);
     }
 
-    this._disableScroll();
+    if ($('.reveal:visible').length === 0) {
+      this._disableScroll();
+    }
 
     var _this = this;
 
@@ -446,7 +448,9 @@ class Reveal extends Plugin {
 
       _this.$element.attr('aria-hidden', true);
 
-      _this._enableScroll(scrollTop);
+      if ($('.reveal:visible').length  === 0) {
+        _this._enableScroll(scrollTop);
+      }
 
       /**
       * Fires when the modal is done closing.