extending implementation, bugfixes

10.3.x-maintenance
cTn 2014-01-22 16:28:52 +01:00
parent a1e4111996
commit 3d5e333c6d
1 changed files with 11 additions and 29 deletions

40
main.js
View File

@ -195,30 +195,21 @@ function add_custom_spinners() {
up();
});
$('.up', spinner).mousedown(function() {
var self = $(this);
self.data('mousedown', true);
$('.up', spinner).mousedown(function() {
GUI.timeout_add('spinner', function() {
if (self.data('mousedown')) {
GUI.interval_add('spinner', function() {
up();
GUI.interval_add('spinner', function() {
up();
}, 100);
}
}, 100, true);
}, 250);
});
$('.up', spinner).mouseup(function() {
var self = $(this);
self.data('mousedown', false);
GUI.timeout_remove('spinner');
GUI.interval_remove('spinner');
});
$('.up', spinner).mouseleave(function() {
var self = $(this);
self.data('mousedown', false);
$('.up', spinner).mouseleave(function() {
GUI.timeout_remove('spinner');
GUI.interval_remove('spinner');
});
@ -227,30 +218,21 @@ function add_custom_spinners() {
down();
});
$('.down', spinner).mousedown(function() {
var self = $(this);
self.data('mousedown', true);
$('.down', spinner).mousedown(function() {
GUI.timeout_add('spinner', function() {
if (self.data('mousedown')) {
GUI.interval_add('spinner', function() {
down();
GUI.interval_add('spinner', function() {
down();
}, 100);
}
}, 100, true);
}, 250);
});
$('.down', spinner).mouseup(function() {
var self = $(this);
self.data('mousedown', false);
GUI.timeout_remove('spinner');
GUI.interval_remove('spinner');
});
$('.down', spinner).mouseleave(function() {
var self = $(this);
self.data('mousedown', false);
GUI.timeout_remove('spinner');
GUI.interval_remove('spinner');
});