mirror of https://github.com/BTCPrivate/copay.git
Replaces custom-fastClick by Angular-Stateful-Fastclick (#4136)
* Replaces custom-fastClick by Angular-Stateful-Fastclick * Resolves fastclick version
This commit is contained in:
parent
265dc26666
commit
c27759b770
|
@ -82,18 +82,21 @@ module.exports = function(grunt) {
|
||||||
sourceMapStyle: 'link' // embed, link, inline
|
sourceMapStyle: 'link' // embed, link, inline
|
||||||
},
|
},
|
||||||
angular: {
|
angular: {
|
||||||
src: [
|
src: [
|
||||||
'bower_components/qrcode-generator/js/qrcode.js',
|
'bower_components/qrcode-generator/js/qrcode.js',
|
||||||
'bower_components/qrcode-decoder-js/lib/qrcode-decoder.js',
|
'bower_components/qrcode-decoder-js/lib/qrcode-decoder.js',
|
||||||
'bower_components/moment/min/moment-with-locales.js',
|
'bower_components/moment/min/moment-with-locales.js',
|
||||||
'bower_components/angular/angular.js',
|
'bower_components/angular/angular.js',
|
||||||
'bower_components/angular-ui-router/release/angular-ui-router.js',
|
'bower_components/angular-ui-router/release/angular-ui-router.js',
|
||||||
'bower_components/angular-foundation/mm-foundation-tpls.js',
|
'bower_components/angular-foundation/mm-foundation-tpls.js',
|
||||||
|
'bower_components/angular-touch/angular-touch.js',
|
||||||
|
'bower_components/fastclick/lib/fastclick.js',
|
||||||
|
'bower_components/stateful-fastclick/dist/stateful-fastclick.js',
|
||||||
|
'bower_components/angular-stateful-fastclick/lib/angular-stateful-fastclick.js',
|
||||||
'bower_components/angular-moment/angular-moment.js',
|
'bower_components/angular-moment/angular-moment.js',
|
||||||
'bower_components/ng-lodash/build/ng-lodash.js',
|
'bower_components/ng-lodash/build/ng-lodash.js',
|
||||||
'bower_components/angular-qrcode/angular-qrcode.js',
|
'bower_components/angular-qrcode/angular-qrcode.js',
|
||||||
'bower_components/angular-gettext/dist/angular-gettext.js',
|
'bower_components/angular-gettext/dist/angular-gettext.js',
|
||||||
'bower_components/angular-touch/angular-touch.js',
|
|
||||||
'bower_components/angular-ui-switch/angular-ui-switch.js',
|
'bower_components/angular-ui-switch/angular-ui-switch.js',
|
||||||
'bower_components/angular-sanitize/angular-sanitize.js',
|
'bower_components/angular-sanitize/angular-sanitize.js',
|
||||||
'bower_components/ng-csv/build/ng-csv.js',
|
'bower_components/ng-csv/build/ng-csv.js',
|
||||||
|
|
|
@ -21,10 +21,15 @@
|
||||||
"ng-lodash": "0.2.3",
|
"ng-lodash": "0.2.3",
|
||||||
"qrcode-decoder-js": "*",
|
"qrcode-decoder-js": "*",
|
||||||
"trezor-connect": "~1.0.1",
|
"trezor-connect": "~1.0.1",
|
||||||
"ng-csv": "~0.3.6"
|
"ng-csv": "~0.3.6",
|
||||||
|
"angular-touch": "^1.5.5",
|
||||||
|
"fastclick": "^1.0.6",
|
||||||
|
"stateful-fastclick": "^1.0.2",
|
||||||
|
"angular-stateful-fastclick": "^1.0.2"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"angular": "1.4.6",
|
"angular": "1.4.6",
|
||||||
"qrcode-generator": "0.1.0"
|
"qrcode-generator": "0.1.0",
|
||||||
|
"fastclick": "1.0.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
}"></section>
|
}"></section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="close-menu" fast-click callback-fn="index.closeMenu()"></a>
|
<a class="close-menu" ng-click="index.closeMenu()"></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
ng-style="{'background-color': '#2b71b1'}">
|
ng-style="{'background-color': '#2b71b1'}">
|
||||||
<section class="left-small">
|
<section class="left-small">
|
||||||
<a class="p10"
|
<a class="p10"
|
||||||
fast-click callback-fn="topbar.goHome()">
|
ng-click="topbar.goHome()">
|
||||||
<span class="text-close">Close</span>
|
<span class="text-close">Close</span>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="right-small">
|
<section class="right-small">
|
||||||
<a class="p10" fast-click callback-fn="$root.go('preferencesCoinbase')">
|
<a class="p10" ng-click="$root.go('preferencesCoinbase')">
|
||||||
<i class="fi-widget size-24"></i>
|
<i class="fi-widget size-24"></i>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
ng-repeat="item in sidebar.wallets track by $index"
|
ng-repeat="item in sidebar.wallets track by $index"
|
||||||
ng-class="{'selected': item.id == index.walletId}"
|
ng-class="{'selected': item.id == index.walletId}"
|
||||||
class="nav-item">
|
class="nav-item">
|
||||||
<a fast-click callback-fn="sidebar.closeMenu(); sidebar.switchWallet(item.id, index.walletId)" class="oh">
|
<a ng-click="sidebar.closeMenu(); sidebar.switchWallet(item.id, index.walletId)" class="oh">
|
||||||
<div class="avatar-wallet"
|
<div class="avatar-wallet"
|
||||||
ng-style="{'background-color':item.color}">
|
ng-style="{'background-color':item.color}">
|
||||||
<i class="icon-wallet size-21"></i>
|
<i class="icon-wallet size-21"></i>
|
||||||
|
|
|
@ -3,21 +3,21 @@
|
||||||
ng-style="{'background-color': noColor ? '#4B6178' : index.backgroundColor}">
|
ng-style="{'background-color': noColor ? '#4B6178' : index.backgroundColor}">
|
||||||
<section class="left-small">
|
<section class="left-small">
|
||||||
<a id="hamburger" class="p10" ng-show="!goBackToState && !closeToHome && !index.noFocusedWallet"
|
<a id="hamburger" class="p10" ng-show="!goBackToState && !closeToHome && !index.noFocusedWallet"
|
||||||
fast-click callback-fn="index.openMenu()"><i class="fi-list size-24"></i>
|
ng-click="index.openMenu()"><i class="fi-list size-24"></i>
|
||||||
</a>
|
</a>
|
||||||
<a ng-show="goBackToState"
|
<a ng-show="goBackToState"
|
||||||
fast-click callback-fn="$root.go(goBackToState); goBackToState = null"><i class="icon-arrow-left3 icon-back"></i>
|
ng-click="$root.go(goBackToState); goBackToState = null"><i class="icon-arrow-left3 icon-back"></i>
|
||||||
<span class="text-back">{{'Back'|translate}}</span>
|
<span class="text-back">{{'Back'|translate}}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a ng-show="closeToHome" class="p10 "
|
<a ng-show="closeToHome" class="p10 "
|
||||||
fast-click callback-fn="topbar.goHome(); index.setCompactTxHistory(); closeToHome = null">
|
ng-click="topbar.goHome(); index.setCompactTxHistory(); closeToHome = null">
|
||||||
<span class="text-close">{{'Close'|translate}}</span>
|
<span class="text-close">{{'Close'|translate}}</span>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="right-small" ng-show="showPreferences && !index.noFocusedWallet">
|
<section class="right-small" ng-show="showPreferences && !index.noFocusedWallet">
|
||||||
<a class="p10" fast-click callback-fn="topbar.goPreferences(); index.setCompactTxHistory()">
|
<a class="p10" ng-click="topbar.goPreferences(); index.setCompactTxHistory()">
|
||||||
<i class="fi-widget size-24"></i>
|
<i class="fi-widget size-24"></i>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="ng-animate-disabled row collapse last-transactions-content line-b"
|
<div class="ng-animate-disabled row collapse last-transactions-content line-b"
|
||||||
ng-class="{'text-gray':!tx.pendingForUs}"
|
ng-class="{'text-gray':!tx.pendingForUs}"
|
||||||
fast-click callback-fn="home.openTxpModal(tx, index.copayers, !!index.glideraStatus)">
|
ng-click="home.openTxpModal(tx, index.copayers, !!index.glideraStatus)">
|
||||||
<div class="large-6 medium-6 small-6 columns size-14">
|
<div class="large-6 medium-6 small-6 columns size-14">
|
||||||
<div class="m10r left pr">
|
<div class="m10r left pr">
|
||||||
<i class="icon-circle-active size-10" ng-show="tx.pendingForUs" ng-style="{'color':index.backgroundColor}"></i>
|
<i class="icon-circle-active size-10" ng-show="tx.pendingForUs" ng-style="{'color':index.backgroundColor}"></i>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<nav class="tab-bar" ng-style="{'background-color':txc.color}">
|
<nav class="tab-bar" ng-style="{'background-color':txc.color}">
|
||||||
<section class="left-small">
|
<section class="left-small">
|
||||||
<a fast-click callback-fn="txc.cancel()">
|
<a ng-click="txc.cancel()">
|
||||||
<i class="icon-arrow-left3 icon-back"></i>
|
<i class="icon-arrow-left3 icon-back"></i>
|
||||||
<span class="text-back" translate>Back</span>
|
<span class="text-back" translate>Back</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div ng-init="wallets[0] ? selectedWalletsOpt = true : selectedWalletsOpt = false; checkClipboard()">
|
<div ng-init="wallets[0] ? selectedWalletsOpt = true : selectedWalletsOpt = false; checkClipboard()">
|
||||||
<nav class="tab-bar" ng-style="{'background-color':color}">
|
<nav class="tab-bar" ng-style="{'background-color':color}">
|
||||||
<section class="left-small">
|
<section class="left-small">
|
||||||
<a ng-show="!editAddressbook && !addAddressbookEntry" fast-click callback-fn="cancel()" class="p10">
|
<a ng-show="!editAddressbook && !addAddressbookEntry" ng-click="cancel()" class="p10">
|
||||||
<span class="text-close" translate>Close</span>
|
<span class="text-close" translate>Close</span>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<span translate>Sent</span>
|
<span translate>Sent</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center m20t">
|
<div class="text-center m20t">
|
||||||
<a class="button outline round light-gray tiny small-4" fast-click callback-fn="cancel()" translate>OKAY</a>
|
<a class="button outline round light-gray tiny small-4" ng-click="cancel()" translate>OKAY</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
<span translate>Payment Proposal Created</span>
|
<span translate>Payment Proposal Created</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<a class="button outline round light-gray tiny small-4" fast-click callback-fn="cancel()" translate>OKAY</a>
|
<a class="button outline round light-gray tiny small-4" ng-click="cancel()" translate>OKAY</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
<span translate>Payment Accepted</span>
|
<span translate>Payment Accepted</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<a class="button outline round light-gray tiny small-4" fast-click callback-fn="cancel()" translate>OKAY</a>
|
<a class="button outline round light-gray tiny small-4" ng-click="cancel()" translate>OKAY</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -41,6 +41,6 @@
|
||||||
<span translate>Payment Rejected</span>
|
<span translate>Payment Rejected</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<a class="button outline light-gray round tiny small-4" fast-click callback-fn="cancel()" translate>OKAY</a>
|
<a class="button outline light-gray round tiny small-4" ng-click="cancel()" translate>OKAY</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -219,7 +219,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div ng-repeat="btx in index.txHistorySearchResults track by btx.txid"
|
<div ng-repeat="btx in index.txHistorySearchResults track by btx.txid"
|
||||||
fast-click callback-fn="home.openTxModal(btx)"
|
ng-click="home.openTxModal(btx)"
|
||||||
class="row collapse last-transactions-content">
|
class="row collapse last-transactions-content">
|
||||||
<div class="large-6 medium-6 small-6 columns size-14">
|
<div class="large-6 medium-6 small-6 columns size-14">
|
||||||
<div class="m10r left">
|
<div class="m10r left">
|
||||||
|
@ -437,7 +437,7 @@
|
||||||
</div>
|
</div>
|
||||||
<a class="postfix size-12 m0 text-gray"
|
<a class="postfix size-12 m0 text-gray"
|
||||||
ng-style="{'color':index.backgroundColor}"
|
ng-style="{'color':index.backgroundColor}"
|
||||||
fast-click callback-fn="home.openDestinationAddressModal(index.otherWallets, _address)">
|
ng-click="home.openDestinationAddressModal(index.otherWallets, _address)">
|
||||||
<i class="icon-wallet text-bold size-18"></i>
|
<i class="icon-wallet text-bold size-18"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -505,11 +505,11 @@
|
||||||
|
|
||||||
<div class="row" ng-show="!home.onGoingProcess">
|
<div class="row" ng-show="!home.onGoingProcess">
|
||||||
<div class="large-6 medium-6 small-6 columns" ng-show="!home.blockUx && (home._paypro || home.lockAddress || home.lockAmount)">
|
<div class="large-6 medium-6 small-6 columns" ng-show="!home.blockUx && (home._paypro || home.lockAddress || home.lockAmount)">
|
||||||
<a fast-click callback-fn="home.resetForm(sendForm)" class="button expand outline dark-gray round" translate>Cancel</a>
|
<a ng-click="home.resetForm(sendForm)" class="button expand outline dark-gray round" translate>Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="columns" ng-class="{'small-6 medium-6 large-6':(home._paypro || home.lockAddress || home.lockAmount)}">
|
<div class="columns" ng-class="{'small-6 medium-6 large-6':(home._paypro || home.lockAddress || home.lockAmount)}">
|
||||||
<button class="button black round expand" ng-disabled="sendForm.$invalid || home.blockUx || index.isOffline || home.paymentExpired"
|
<button class="button black round expand" ng-disabled="sendForm.$invalid || home.blockUx || index.isOffline || home.paymentExpired"
|
||||||
ng-style="{'background-color':index.backgroundColor}" fast-click callback-fn="home.submitForm()" translate>
|
ng-style="{'background-color':index.backgroundColor}" ng-click="home.submitForm()" translate>
|
||||||
Send
|
Send
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,6 +10,7 @@ var modules = [
|
||||||
'uiSwitch',
|
'uiSwitch',
|
||||||
'ngSanitize',
|
'ngSanitize',
|
||||||
'ngCsv',
|
'ngCsv',
|
||||||
|
'ngTouch',
|
||||||
'bwcModule',
|
'bwcModule',
|
||||||
'copayApp.filters',
|
'copayApp.filters',
|
||||||
'copayApp.services',
|
'copayApp.services',
|
||||||
|
|
|
@ -318,65 +318,4 @@ angular.module('copayApp.directives')
|
||||||
templateUrl: 'views/includes/available-balance.html'
|
templateUrl: 'views/includes/available-balance.html'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.directive('fastClick', [ 'isCordova', '$timeout', 'isMobile', function(isCordova, $timeout, isMobile) {
|
|
||||||
return {
|
|
||||||
scope: { someCtrlFn: '&callbackFn'},
|
|
||||||
link: function(scope, element, attrs) {
|
|
||||||
|
|
||||||
var isWindowsPhoneApp = isMobile.Windows() && isCordova;
|
|
||||||
if (!isCordova || isWindowsPhoneApp) {
|
|
||||||
element.on('click', function(){
|
|
||||||
scope.someCtrlFn();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
var trackingClick = false;
|
|
||||||
var targetElement = null;
|
|
||||||
var touchStartX = 0;
|
|
||||||
var touchStartY = 0;
|
|
||||||
var touchBoundary = 10;
|
|
||||||
|
|
||||||
element.on('touchstart', function(event) {
|
|
||||||
|
|
||||||
trackingClick = true;
|
|
||||||
targetElement = event.target;
|
|
||||||
touchStartX = event.targetTouches[0].pageX;
|
|
||||||
touchStartY = event.targetTouches[0].pageY;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
element.on('touchend', function(event) {
|
|
||||||
if (trackingClick) {
|
|
||||||
scope.someCtrlFn();
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
trackingClick = false;
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
element.on('touchmove', function(event) {
|
|
||||||
if (!trackingClick) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the touch has moved, cancel the click tracking
|
|
||||||
if (targetElement !== event.target
|
|
||||||
|| (Math.abs(event.changedTouches[0].pageX - touchStartX) > touchBoundary
|
|
||||||
|| (Math.abs(event.changedTouches[0].pageY - touchStartY) > touchBoundary))) {
|
|
||||||
trackingClick = false;
|
|
||||||
targetElement = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
element.on('touchcancel', function() {
|
|
||||||
trackingClick = false;
|
|
||||||
targetElement = null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]);
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in New Issue