]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
style: document the #10786 bug in Reveal 10786/head
authorNicolas Coden <nicolas@ncoden.fr>
Sat, 20 Jan 2018 14:43:38 +0000 (15:43 +0100)
committerNicolas Coden <nicolas@ncoden.fr>
Sat, 20 Jan 2018 14:43:38 +0000 (15:43 +0100)
js/foundation.reveal.js

index 3c1bad7532a149d65c3c6f9ab644d0ab79edac93..bc08d956df6a192a551232505bb57f3632dbd419 100644 (file)
@@ -184,7 +184,7 @@ class Reveal extends Plugin {
 
   /**
   * Disables the scroll when Reveal is shown to prevent the background from shifting
-  * @param {number} scrollTop
+  * @param {number} scrollTop - Scroll to visually apply, window current scroll by default
   */
   _disableScroll(scrollTop) {
     scrollTop = scrollTop || $(window).scrollTop();
@@ -196,7 +196,7 @@ class Reveal extends Plugin {
 
   /**
   * Reenables the scroll when Reveal closes
-  * @param {number} scrollTop
+  * @param {number} scrollTop - Scroll to restore, html "top" property by default (as set by `_disableScroll`)
   */
   _enableScroll(scrollTop) {
     scrollTop = scrollTop || parseInt($("html").css("top"));
@@ -400,6 +400,9 @@ class Reveal extends Plugin {
 
     function finishUp() {
 
+      // Get the current top before the modal is closed and restore the scroll after.
+      // TODO: use component properties instead of HTML properties
+      // See https://github.com/zurb/foundation-sites/pull/10786
       var scrollTop = parseInt($("html").css("top"));
 
       if ($('.reveal:visible').length  === 0) {