From 768b3f3affbb059b6423e96d306590fc54f16cfd Mon Sep 17 00:00:00 2001 From: Marius Burkard <m.burkard@pixcept.de> Date: Fri, 17 Jun 2016 12:05:19 -0400 Subject: [PATCH] - interrupt scrolling on user input, fixed #3936 --- interface/web/themes/default/assets/javascripts/ispconfig.js | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/interface/web/themes/default/assets/javascripts/ispconfig.js b/interface/web/themes/default/assets/javascripts/ispconfig.js index 7d7dd3f..a2b9907 100644 --- a/interface/web/themes/default/assets/javascripts/ispconfig.js +++ b/interface/web/themes/default/assets/javascripts/ispconfig.js @@ -364,9 +364,11 @@ }, loadInitContent: function() { + var startpage = $('#pageContent').attr('data-startpage'); + if(!startpage) startpage = 'dashboard/dashboard.php'; var pageContentObject = $.ajax({ type: "GET", - url: "dashboard/dashboard.php", + url: startpage, data: "", dataType: "html", beforeSend: function() { @@ -616,9 +618,12 @@ } }); +var $page = $('html, body'); + $(document).on('click', 'a[data-load-content],button[data-load-content]', function(e) { e.preventDefault(); - $('html, body').animate({scrollTop: 0}, 1000); + $page.on('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); }); + $page.animate({scrollTop: 0}, 1000, function() { $page.off('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); }); }); var content_to_load = $(this).attr('data-load-content'); if(!content_to_load) return this; @@ -628,7 +633,8 @@ $(document).on('click', 'a[data-capp],button[data-capp]', function(e) { e.preventDefault(); - $('html, body').animate({scrollTop: 0}, 1000); + $page.on('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); }); + $page.animate({scrollTop: 0}, 1000, function() { $page.off('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); }); }); var content_to_load = $(this).attr('data-capp'); if(!content_to_load) return this; @@ -638,7 +644,8 @@ $(document).on('click', 'a[data-submit-form],button[data-submit-form]', function(e) { e.preventDefault(); - $('html, body').animate({scrollTop: 0}, 1000); + $page.on('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); }); + $page.animate({scrollTop: 0}, 1000, function() { $page.off('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); }); }); var $el = $(this); var act = $el.attr('data-form-action'); -- Gitblit v1.9.1