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