remove angular foundation and use only ionic modals
This commit is contained in:
parent
61f6909d9a
commit
0cca8f6367
24 changed files with 249 additions and 230 deletions
|
|
@ -1,10 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').factory('txStatus', function($modal, lodash, profileService, $timeout, txFormatService, platformInfo) {
|
||||
angular.module('copayApp.services').factory('txStatus', function(lodash, profileService, $timeout, platformInfo) {
|
||||
var root = {};
|
||||
var isCordova = platformInfo.isCordova;
|
||||
|
||||
root.notify = function(txp, cb) {
|
||||
root.notify = function(txp) {
|
||||
var fc = profileService.focusedClient;
|
||||
var status = txp.status;
|
||||
var type;
|
||||
|
|
@ -19,11 +19,11 @@ angular.module('copayApp.services').factory('txStatus', function($modal, lodash,
|
|||
copayerId: fc.credentials.copayerId
|
||||
});
|
||||
|
||||
if (!action) {
|
||||
if (!action) {
|
||||
type = 'created';
|
||||
} else if (action.type == 'accept') {
|
||||
// created and accepted at the same time?
|
||||
if ( n == 1 && action.createdOn - txp.createdOn < INMEDIATE_SECS ) {
|
||||
if (n == 1 && action.createdOn - txp.createdOn < INMEDIATE_SECS) {
|
||||
type = 'created';
|
||||
} else {
|
||||
type = 'accepted';
|
||||
|
|
@ -34,41 +34,7 @@ angular.module('copayApp.services').factory('txStatus', function($modal, lodash,
|
|||
throw new Error('Unknown type:' + type);
|
||||
}
|
||||
}
|
||||
|
||||
openModal(type, txp, cb);
|
||||
};
|
||||
|
||||
root._templateUrl = function(type, txp) {
|
||||
return 'views/modals/tx-status.html';
|
||||
};
|
||||
|
||||
var openModal = function(type, txp, cb) {
|
||||
var fc = profileService.focusedClient;
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||
$scope.type = type;
|
||||
$scope.tx = txFormatService.processTx(txp);
|
||||
$scope.color = fc.backgroundColor;
|
||||
if (isCordova && StatusBar.isVisible) {
|
||||
StatusBar.hide();
|
||||
}
|
||||
$scope.cancel = function() {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
if (cb) $timeout(cb, 100);
|
||||
};
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: root._templateUrl(type, txp),
|
||||
windowClass: 'popup-tx-status full',
|
||||
controller: ModalInstanceCtrl,
|
||||
});
|
||||
|
||||
modalInstance.result.finally(function() {
|
||||
if (isCordova && !StatusBar.isVisible) {
|
||||
StatusBar.show();
|
||||
}
|
||||
var m = angular.element(document.getElementsByClassName('reveal-modal'));
|
||||
m.addClass('hideModal');
|
||||
});
|
||||
return type;
|
||||
};
|
||||
|
||||
return root;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue