fix touchdown default in android. reconnecting debouce
This commit is contained in:
parent
5c3b65c38b
commit
476d5ecba7
3 changed files with 10 additions and 10 deletions
|
|
@ -588,7 +588,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
$rootScope.$on('Local/Offline', function(event) {
|
$rootScope.$on('Local/Offline', function(event) {
|
||||||
$log.debug('### Offline event');
|
$log.debug('### Offline event');
|
||||||
if (!self.offLineSince) self.offLineSince = Date.now();
|
if (!self.offLineSince) self.offLineSince = Date.now();
|
||||||
if (Date.now() - sef.offLineSince > 1000) {
|
|
||||||
|
if (Date.now() - self.offLineSince > 10000) {
|
||||||
self.isOffline = true;
|
self.isOffline = true;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$rootScope.$apply();
|
$rootScope.$apply();
|
||||||
|
|
|
||||||
|
|
@ -48,16 +48,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
var disableOnlineListener = $rootScope.$on('Local/Online', function() {
|
var disableOnlineListener = $rootScope.$on('Local/Online', function() {
|
||||||
// This is needed then the apps go to sleep
|
// This is needed then the apps go to sleep
|
||||||
$timeout(function() {
|
self.bindTouchDown();
|
||||||
self.bindTouchDown();
|
|
||||||
}, 2000);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var disableResumeListener = $rootScope.$on('Local/Resume', function() {
|
var disableResumeListener = $rootScope.$on('Local/Resume', function() {
|
||||||
// This is needed then the apps go to sleep
|
// This is needed then the apps go to sleep
|
||||||
$timeout(function() {
|
self.bindTouchDown();
|
||||||
self.bindTouchDown();
|
|
||||||
}, 2000);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -391,8 +387,11 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
['hamburger', 'menu-walletHome', 'menu-send', 'menu-receive', 'menu-history'].forEach(function(id) {
|
['hamburger', 'menu-walletHome', 'menu-send', 'menu-receive', 'menu-history'].forEach(function(id) {
|
||||||
var e = document.getElementById(id);
|
var e = document.getElementById(id);
|
||||||
if (e) e.addEventListener('touchstart', function() {
|
if (e) e.addEventListener('touchstart', function() {
|
||||||
|
try {
|
||||||
|
event.preventDefault();
|
||||||
|
} catch (e) {};
|
||||||
angular.element(e).triggerHandler('click');
|
angular.element(e).triggerHandler('click');
|
||||||
});
|
}, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ function makeSwipeDirective(directiveName, direction, eventName) {
|
||||||
// The maximum vertical delta for a swipe should be less than 75px.
|
// The maximum vertical delta for a swipe should be less than 75px.
|
||||||
var MAX_VERTICAL_DISTANCE = 75;
|
var MAX_VERTICAL_DISTANCE = 75;
|
||||||
// Vertical distance should not be more than a fraction of the horizontal distance.
|
// Vertical distance should not be more than a fraction of the horizontal distance.
|
||||||
var MAX_VERTICAL_RATIO = 0.3;
|
var MAX_VERTICAL_RATIO = 0.4;
|
||||||
// At least a 30px lateral motion is necessary for a swipe.
|
// At least a 30px lateral motion is necessary for a swipe.
|
||||||
var MIN_HORIZONTAL_DISTANCE = 25;
|
var MIN_HORIZONTAL_DISTANCE = 30;
|
||||||
|
|
||||||
return function(scope, element, attr) {
|
return function(scope, element, attr) {
|
||||||
var swipeHandler = $parse(attr[directiveName]);
|
var swipeHandler = $parse(attr[directiveName]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue