From: Daniel Ruf Date: Sun, 11 Mar 2018 22:35:53 +0000 (+0100) Subject: fix: remove the open classes if no visible reveal exists after destroying one X-Git-Tag: v6.6.0~3^2~281^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21976813a;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fix: remove the open classes if no visible reveal exists after destroying one --- diff --git a/js/foundation.reveal.js b/js/foundation.reveal.js index 32c5d49fc..5f95eef4f 100644 --- a/js/foundation.reveal.js +++ b/js/foundation.reveal.js @@ -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(); + } }; }