commit
16c0c58d32
25 changed files with 511 additions and 129 deletions
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.directives')
|
||||
.directive('actionSheet', function() {
|
||||
.directive('actionSheet', function($rootScope, $timeout) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'views/includes/actionSheet.html',
|
||||
|
|
@ -10,8 +10,16 @@ angular.module('copayApp.directives')
|
|||
show: '=actionSheetShow',
|
||||
},
|
||||
link: function(scope, element, attrs) {
|
||||
scope.$watch('show', function() {
|
||||
if(scope.show) {
|
||||
$timeout(function() { scope.revealMenu = true; }, 100);
|
||||
} else {
|
||||
scope.revealMenu = false;
|
||||
}
|
||||
});
|
||||
scope.hide = function() {
|
||||
scope.show = false;
|
||||
$rootScope.$broadcast('incomingDataMenu.menuHidden');
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
|||
50
src/js/directives/incomingDataMenu.js
Normal file
50
src/js/directives/incomingDataMenu.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.directives')
|
||||
.directive('incomingDataMenu', function($timeout, $rootScope, $state, externalLinkService) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'views/includes/incomingDataMenu.html',
|
||||
link: function(scope, element, attrs) {
|
||||
$rootScope.$on('incomingDataMenu.showMenu', function(event, data) {
|
||||
$timeout(function() {
|
||||
scope.data = data.data;
|
||||
scope.type = data.type;
|
||||
scope.showMenu = true;
|
||||
scope.https = false;
|
||||
|
||||
if(scope.type === 'url') {
|
||||
if(scope.data.indexOf('https://') === 0) {
|
||||
scope.https = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
scope.hide = function() {
|
||||
scope.showMenu = false;
|
||||
$rootScope.$broadcast('incomingDataMenu.menuHidden');
|
||||
};
|
||||
scope.goToUrl = function(url){
|
||||
externalLinkService.open(url);
|
||||
};
|
||||
scope.sendPaymentToAddress = function(bitcoinAddress) {
|
||||
scope.showMenu = false;
|
||||
$state.go('tabs.send').then(function() {
|
||||
$timeout(function() {
|
||||
$state.transitionTo('tabs.send.amount', {toAddress: bitcoinAddress});
|
||||
}, 50);
|
||||
});
|
||||
};
|
||||
scope.addToAddressBook = function(bitcoinAddress) {
|
||||
scope.showMenu = false;
|
||||
$timeout(function() {
|
||||
$state.go('tabs.send').then(function() {
|
||||
$timeout(function() {
|
||||
$state.transitionTo('tabs.send.addressbook', {addressbookEntry: bitcoinAddress});
|
||||
});
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue