Skip to content

Commit 768b3f3

Browse files
author
Marius Burkard
committed
- interrupt scrolling on user input, fixed #3936
1 parent 37d53f6 commit 768b3f3

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

interface/web/themes/default/assets/javascripts/ispconfig.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,12 @@ $(document).on("change", function(event) {
618618
}
619619
});
620620

621+
var $page = $('html, body');
622+
621623
$(document).on('click', 'a[data-load-content],button[data-load-content]', function(e) {
622624
e.preventDefault();
623-
$('html, body').animate({scrollTop: 0}, 1000);
625+
$page.on('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); });
626+
$page.animate({scrollTop: 0}, 1000, function() { $page.off('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); }); });
624627

625628
var content_to_load = $(this).attr('data-load-content');
626629
if(!content_to_load) return this;
@@ -630,7 +633,8 @@ $(document).on('click', 'a[data-load-content],button[data-load-content]', functi
630633

631634
$(document).on('click', 'a[data-capp],button[data-capp]', function(e) {
632635
e.preventDefault();
633-
$('html, body').animate({scrollTop: 0}, 1000);
636+
$page.on('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); });
637+
$page.animate({scrollTop: 0}, 1000, function() { $page.off('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); }); });
634638

635639
var content_to_load = $(this).attr('data-capp');
636640
if(!content_to_load) return this;
@@ -640,7 +644,8 @@ $(document).on('click', 'a[data-capp],button[data-capp]', function(e) {
640644

641645
$(document).on('click', 'a[data-submit-form],button[data-submit-form]', function(e) {
642646
e.preventDefault();
643-
$('html, body').animate({scrollTop: 0}, 1000);
647+
$page.on('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); });
648+
$page.animate({scrollTop: 0}, 1000, function() { $page.off('scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove', function() { $page.stop(); }); });
644649

645650
var $el = $(this);
646651
var act = $el.attr('data-form-action');

interface/web/themes/default/templates/main.tpl.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<script type="text/javascript" src="js/jquery.min.js"></script>
8585
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/bootstrap.min.js'></script>
8686
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/bootstrap-datetimepicker.min.js'></script>
87-
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/ispconfig.min.js'></script>
87+
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/ispconfig.js'></script>
8888
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/modernizr.custom.min.js'></script>
8989
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/pushy.min.js'></script>
9090
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/responsive.min.js'></script>

interface/web/themes/default/templates/main_login.tpl.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<script type="text/javascript" src="../js/jquery.min.js"></script>
4242
<script src='../themes/<tmpl_var name='current_theme'>/assets/javascripts/bootstrap.min.js'></script>
4343
<script src='../themes/<tmpl_var name='current_theme'>/assets/javascripts/bootstrap-datetimepicker.min.js'></script>
44-
<script src='../themes/<tmpl_var name='current_theme'>/assets/javascripts/ispconfig.min.js'></script>
44+
<script src='../themes/<tmpl_var name='current_theme'>/assets/javascripts/ispconfig.js'></script>
4545
<script src='../themes/<tmpl_var name='current_theme'>/assets/javascripts/modernizr.custom.min.js'></script>
4646
<script src='../themes/<tmpl_var name='current_theme'>/assets/javascripts/pushy.min.js'></script>
4747
<script src='../themes/<tmpl_var name='current_theme'>/assets/javascripts/responsive.min.js'></script>

0 commit comments

Comments
 (0)