added additional options to external service to provide custom message. disabled confirm dialog where needed
This commit is contained in:
parent
3d9e40b4c5
commit
fa7c746f5e
19 changed files with 73 additions and 57 deletions
|
|
@ -1,8 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').service('externalLinkService', function(platformInfo, nodeWebkitService, popupService, gettextCatalog) {
|
||||
angular.module('copayApp.services').service('externalLinkService', function(platformInfo, nodeWebkitService, popupService, gettextCatalog, $window, $log, $timeout) {
|
||||
|
||||
this.open = function(url, optIn, title, desc, okText, cancelText) {
|
||||
this.open = function(url, optIn, title, message, okText, cancelText) {
|
||||
var old = $window.handleOpenURL;
|
||||
|
||||
$window.handleOpenURL = function(url) {
|
||||
|
|
@ -17,12 +17,16 @@ angular.module('copayApp.services').service('externalLinkService', function(plat
|
|||
if (platformInfo.isNW) {
|
||||
nodeWebkitService.openExternalLink(url);
|
||||
} else {
|
||||
var message = gettextCatalog.getString(desc),
|
||||
title = gettextCatalog.getString(title),
|
||||
openBrowser = function(res) {
|
||||
if (res) window.open(url, '_system');
|
||||
};
|
||||
popupService.showConfirm(title, message, 'Open', 'Cancel', openBrowser);
|
||||
if (optIn) {
|
||||
var message = gettextCatalog.getString(message),
|
||||
title = gettextCatalog.getString(title),
|
||||
okText = gettextCatalog.getString(okText),
|
||||
cancelText = gettextCatalog.getString(cancelText),
|
||||
openBrowser = function(res) {
|
||||
if (res) window.open(url, '_system');
|
||||
};
|
||||
popupService.showConfirm(title, message, okText, cancelText, openBrowser);
|
||||
} else window.open(url, '_system');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue