1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

extending implementation, bugfixes

This commit is contained in:
cTn 2014-01-22 16:28:52 +01:00
parent a1e4111996
commit 3d5e333c6d

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');
});