From: George Date: Wed, 18 Dec 2013 16:35:41 +0000 (+0000) Subject: Fix bug where joyride fails to scroll up for next tip X-Git-Tag: 5.0.3~58^2~3^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3921%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix bug where joyride fails to scroll up for next tip If the next tip is higher on the page than current tip a negative tipOffset results in joyride not scrolling to show position of the next tip. This commit fixes that behaviour by scrolling unless tipOffset is 0 which I assume is intended behaviour --- diff --git a/js/foundation/foundation.joyride.js b/js/foundation/foundation.joyride.js index f7140aab9..a62fdde71 100644 --- a/js/foundation/foundation.joyride.js +++ b/js/foundation/foundation.joyride.js @@ -390,7 +390,7 @@ window_half = $(window).height() / 2; tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.settings.$next_tip.outerHeight()); - if (tipOffset > 0) { + if (tipOffset != 0) { $('html, body').animate({ scrollTop: tipOffset }, this.settings.scroll_speed, 'swing');