diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-03 23:18:59 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-03 23:18:59 +0400 |
commit | 0f0b3273bbc8154d0b28d1de865e741b92083bac (patch) | |
tree | cdd8d427878ee3360b7ffb3d9e39494a2378bbac /plugins/Zeitgeist | |
parent | 09784e569760cd28a9488f083583d0016265e535 (diff) |
Refs #3089, show 'no more visits' when no more visits to load in visitor profile and force scroll to new visits when loading more visits.
Diffstat (limited to 'plugins/Zeitgeist')
-rw-r--r-- | plugins/Zeitgeist/javascripts/piwikHelper.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/Zeitgeist/javascripts/piwikHelper.js b/plugins/Zeitgeist/javascripts/piwikHelper.js index 29f9cf436b..1d3760a0c9 100644 --- a/plugins/Zeitgeist/javascripts/piwikHelper.js +++ b/plugins/Zeitgeist/javascripts/piwikHelper.js @@ -297,15 +297,17 @@ var piwikHelper = { * if the top of the element is not currently visible on screen * @param {string} elem Selector for the DOM node to scroll to, eg. '#myDiv' * @param {int} [time] Specifies the duration of the animation in ms + * @param {bool} [forceScroll] Whether to force scroll to an element. * @return {void} */ - lazyScrollTo: function(elem, time) + lazyScrollTo: function(elem, time, forceScroll) { var elemTop = $(elem).offset().top; // only scroll the page if the graph is not visible - if(elemTop < $(window).scrollTop() - || elemTop > $(window).scrollTop()+$(window).height()) - { + if (elemTop < $(window).scrollTop() + || elemTop > $(window).scrollTop()+$(window).height() + || forceScroll + ) { // scroll the page smoothly to the graph $.scrollTo(elem, time); } |