From 2931b573161a0808f94334a503506ff1a8b04b90 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Thu, 28 Feb 2019 14:05:47 +0100 Subject: [PATCH] fix: enable and disable scroll if there is no visible reveal --- js/foundation.reveal.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/foundation.reveal.js b/js/foundation.reveal.js index 13ba0f11d..434f9601e 100644 --- a/js/foundation.reveal.js +++ b/js/foundation.reveal.js @@ -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. -- 2.47.2