From c3c156f6278ea049dca9ff55450b50fc77b21048 Mon Sep 17 00:00:00 2001 From: audiencepoint Date: Fri, 14 Dec 2012 15:14:52 -0800 Subject: [PATCH 1/2] Added a prestep method to the constructor and to the show method. Added a prestep method to the call, basically we needed it so that we could adjust what was visible on the screen before the call out was shown and I was hoping that someone else could use it too. --- jquery.joyride-2.0.2.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jquery.joyride-2.0.2.js b/jquery.joyride-2.0.2.js index 8ebd06d..25cd755 100644 --- a/jquery.joyride-2.0.2.js +++ b/jquery.joyride-2.0.2.js @@ -12,7 +12,7 @@ 'use strict'; var defaults = { - 'version' : '2.0.1', + 'version' : '2.0.2', 'tipLocation' : 'bottom', // 'top' or 'bottom' in relation to parent 'nubPosition' : 'auto', // override on a per tooltip bases 'scrollSpeed' : 300, // Page scrolling speed in milliseconds @@ -29,6 +29,7 @@ 'tipContainer' : 'body', // Where will the tip be attached 'postRideCallback' : $.noop, // A method to call once the tour closes (canceled or complete) 'postStepCallback' : $.noop, // A method to call after each step + 'preStepCallback' : $.noop, // A method to call before each step 'template' : { // HTML segments for tip layout 'link' : 'X', 'timer' : '
', @@ -188,6 +189,9 @@ }, show : function (init) { + //call pre-step method to allow user to adjsut what is visible on screen. + settings.preStepCallback(init=="init"?0:(settings.$li.index()+1)); + var opts = {}, ii, opts_arr = [], opts_len = 0, p, $timer = null; From 35cb6537fe863f6d1de8e9ca222a4202824155c8 Mon Sep 17 00:00:00 2001 From: audiencepoint Date: Mon, 17 Dec 2012 23:36:09 -0800 Subject: [PATCH 2/2] Added a modal property to the step's settings to eliminate scrolling selectively --- jquery.joyride-2.0.2.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/jquery.joyride-2.0.2.js b/jquery.joyride-2.0.2.js index 25cd755..5b35cd3 100644 --- a/jquery.joyride-2.0.2.js +++ b/jquery.joyride-2.0.2.js @@ -30,6 +30,7 @@ 'postRideCallback' : $.noop, // A method to call once the tour closes (canceled or complete) 'postStepCallback' : $.noop, // A method to call after each step 'preStepCallback' : $.noop, // A method to call before each step + 'tipIsModal' : false, 'template' : { // HTML segments for tip layout 'link' : 'X', 'timer' : '
', @@ -225,7 +226,7 @@ settings.tipSettings.tipLocationPattern = settings.tipLocationPatterns[settings.tipSettings.tipLocation]; // scroll if not modal - if (!/body/i.test(settings.$target.selector)) { + if (!/body/i.test(settings.$target.selector) ) { methods.scroll_to(); } @@ -349,9 +350,12 @@ window_half = settings.$window.height() / 2; tipOffset = Math.ceil(settings.$target.offset().top - window_half + settings.$next_tip.outerHeight()); - $("html, body").stop().animate({ - scrollTop: tipOffset - }, settings.scrollSpeed); + if( settings.tipSettings.tipIsModal!="true") + { + $("html, body").stop().animate({ + scrollTop: tipOffset + }, settings.scrollSpeed); + } }, paused : function () {