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
|
@ -89,11 +89,14 @@ module.exports = function(grunt) {
|
|||
'bower_components/angular/angular.js',
|
||||
'bower_components/angular-ui-router/release/angular-ui-router.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/ng-lodash/build/ng-lodash.js',
|
||||
'bower_components/angular-qrcode/angular-qrcode.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-sanitize/angular-sanitize.js',
|
||||
'bower_components/ng-csv/build/ng-csv.js',
|
||||
|
|
|
@ -21,10 +21,15 @@
|
|||
"ng-lodash": "0.2.3",
|
||||
"qrcode-decoder-js": "*",
|
||||
"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": {
|
||||
"angular": "1.4.6",
|
||||
"qrcode-generator": "0.1.0"
|
||||
"qrcode-generator": "0.1.0",
|
||||
"fastclick": "1.0.6"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
}"></section>
|
||||
</div>
|
||||
</div>
|
||||
<a class="close-menu" fast-click callback-fn="index.closeMenu()"></a>
|
||||
<a class="close-menu" ng-click="index.closeMenu()"></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
ng-style="{'background-color': '#2b71b1'}">
|
||||
<section class="left-small">
|
||||
<a class="p10"
|
||||
fast-click callback-fn="topbar.goHome()">
|
||||
ng-click="topbar.goHome()">
|
||||
<span class="text-close">Close</span>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
<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>
|
||||
</a>
|
||||
</section>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
ng-repeat="item in sidebar.wallets track by $index"
|
||||
ng-class="{'selected': item.id == index.walletId}"
|
||||
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"
|
||||
ng-style="{'background-color':item.color}">
|
||||
<i class="icon-wallet size-21"></i>
|
||||
|
|
|
@ -3,21 +3,21 @@
|
|||
ng-style="{'background-color': noColor ? '#4B6178' : index.backgroundColor}">
|
||||
<section class="left-small">
|
||||
<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 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>
|
||||
</a>
|
||||
|
||||
<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>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
<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>
|
||||
</a>
|
||||
</section>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="ng-animate-disabled row collapse last-transactions-content line-b"
|
||||
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="m10r left pr">
|
||||
<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}">
|
||||
<section class="left-small">
|
||||
<a fast-click callback-fn="txc.cancel()">
|
||||
<a ng-click="txc.cancel()">
|
||||
<i class="icon-arrow-left3 icon-back"></i>
|
||||
<span class="text-back" translate>Back</span>
|
||||
</a>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div ng-init="wallets[0] ? selectedWalletsOpt = true : selectedWalletsOpt = false; checkClipboard()">
|
||||
<nav class="tab-bar" ng-style="{'background-color':color}">
|
||||
<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>
|
||||
</a>
|
||||
</section>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<span translate>Sent</span>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
|||
<span translate>Payment Proposal Created</span>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
|||
<span translate>Payment Accepted</span>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
@ -41,6 +41,6 @@
|
|||
<span translate>Payment Rejected</span>
|
||||
</div>
|
||||
<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>
|
||||
|
|
|
@ -219,7 +219,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<div class="large-6 medium-6 small-6 columns size-14">
|
||||
<div class="m10r left">
|
||||
|
@ -437,7 +437,7 @@
|
|||
</div>
|
||||
<a class="postfix size-12 m0 text-gray"
|
||||
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>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -505,11 +505,11 @@
|
|||
|
||||
<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)">
|
||||
<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 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"
|
||||
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
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -10,6 +10,7 @@ var modules = [
|
|||
'uiSwitch',
|
||||
'ngSanitize',
|
||||
'ngCsv',
|
||||
'ngTouch',
|
||||
'bwcModule',
|
||||
'copayApp.filters',
|
||||
'copayApp.services',
|
||||
|
|
|
@ -318,65 +318,4 @@ angular.module('copayApp.directives')
|
|||
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