]> _ Git - fluidbook-v3.git/commitdiff
fix #675 @0:40
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 6 Sep 2016 15:00:11 +0000 (15:00 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 6 Sep 2016 15:00:11 +0000 (15:00 +0000)
js/209-scrollify.js

index 748ad3817a1d794a2d6c085426bbd23433cdefc6..714483380327b3a2b0661b0179862eb917491a71 100644 (file)
         if (disabled === true) {
             return true;
         }
+
+
         if (names[index]) {
             scrollable = false;
 
                     });
                 } else {
 
+                    //fb('scroll to ' + index);
+                    //alert(heights.join(','));
+
                     //console.info(index + ' -- Scrolling to: ' + heights[index] + ' | ' + settings.scrollSpeed + ' | ' + settings.easing);
 
 
                     manualScroll.calculateNearest();
                 }
             },
-            handleScroll: function () {
+            animateScroll: function () {
                 if (disabled === true) {
                     return true;
                 }
             },
             down: function () {
                 if (index <= heights.length - 1) {
-
                     if (atBottom() && index < heights.length - 1) {
-
                         index++;
                         animateScroll(index, false, true);
                     } else {
-                        if (Math.floor(elements[index].height() / $window.height()) > interstitialIndex) {
-
-                            // interstitialScroll(parseInt(heights[index])+($window.height()*interstitialIndex));
-                            interstitialScroll(Math.round(heights[index]) + ($window.height() * interstitialIndex));
+                        if (Math.floor(elements[index].height() / $window.windowHeight()) > interstitialIndex) {
+                            interstitialScroll(Math.round(heights[index]) + ($window.windowHeight() * interstitialIndex));
                             interstitialIndex += 1;
-
                         } else {
-                            // interstitialScroll(parseInt(heights[index])+(elements[index].height()-$window.height()));
-                            interstitialScroll(Math.round(heights[index]) + (elements[index].height() - $window.height()));
+                            interstitialScroll(Math.round(heights[index]) + (elements[index].height() - $window.windowHeight()));
                         }
 
                     }
                 }
             },
             up: function () {
+
                 if (index >= 0) {
                     if (atTop() && index > 0) {
 
                         if (interstitialIndex > 2) {
 
                             interstitialIndex -= 1;
-                            // interstitialScroll(parseInt(heights[index])+($window.height()*interstitialIndex));
-                            interstitialScroll(Math.round(heights[index]) + ($window.height() * interstitialIndex));
+                            // interstitialScroll(parseInt(heights[index])+($window.windowHeight()*interstitialIndex));
+                            interstitialScroll(Math.round(heights[index]) + ($window.windowHeight() * interstitialIndex));
 
                         } else {
 
                         overflow[i] = false;
                     } else {
 
-                        if (($(this).css("height", "auto").outerHeight() < $window.height()) || $(this).css("overflow") === "hidden") {
-                            $(this).css({"height": $window.height()});
+                        if (($(this).css("height", "auto").outerHeight() < $window.windowHeight()) || $(this).css("overflow") === "hidden") {
+                            $(this).css({"height": $window.windowHeight()});
 
                             overflow[i] = false;
                         } else {
 
                 } else {
 
-                    if (($(this).outerHeight() < $window.height()) || (settings.overflowScroll === false)) {
+                    if (($(this).outerHeight() < $window.windowHeight()) || (settings.overflowScroll === false)) {
                         overflow[i] = false;
                     } else {
                         overflow[i] = true;
             }
             top = $window.scrollTop();
 
-            if (top < parseInt(heights[index]) + (elements[index].outerHeight() - $window.height()) - 28) {
+            if (top < parseInt(heights[index]) + (elements[index].outerHeight() - $window.windowHeight()) - 28) {
 
                 return false;