Skip to content

Commit 2931b57

Browse files
author
Daniel Ruf
committed
fix: enable and disable scroll if there is no visible reveal
1 parent 80cc570 commit 2931b57

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

js/foundation.reveal.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ class Reveal extends Plugin {
273273
this.$element.trigger('closeme.zf.reveal', this.id);
274274
}
275275

276-
this._disableScroll();
276+
if ($('.reveal:visible').length === 0) {
277+
this._disableScroll();
278+
}
277279

278280
var _this = this;
279281

@@ -446,7 +448,9 @@ class Reveal extends Plugin {
446448

447449
_this.$element.attr('aria-hidden', true);
448450

449-
_this._enableScroll(scrollTop);
451+
if ($('.reveal:visible').length === 0) {
452+
_this._enableScroll(scrollTop);
453+
}
450454

451455
/**
452456
* Fires when the modal is done closing.

0 commit comments

Comments
 (0)