added new logic to external link service to open in system browser with confirm message to notify them they're leaving and give option to cancel
This commit is contained in:
parent
6f3bd62efb
commit
f808a3afcd
15 changed files with 47 additions and 44 deletions
|
|
@ -1,13 +1,17 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').service('externalLinkService', function(platformInfo, nodeWebkitService) {
|
||||
angular.module('copayApp.services').service('externalLinkService', function(platformInfo, nodeWebkitService, popupService, gettextCatalog) {
|
||||
|
||||
this.open = function(url, target) {
|
||||
this.open = function(url, desc) {
|
||||
if (platformInfo.isNW) {
|
||||
nodeWebkitService.openExternalLink(url);
|
||||
} else {
|
||||
target = target || '_blank';
|
||||
var ref = window.open(url, target, 'location=no');
|
||||
desc = desc || 'this link';
|
||||
var message = gettextCatalog.getString('You are leaving to view ' + desc + ''),
|
||||
openBrowser = function(res) {
|
||||
if (res) window.open(url, '_system');
|
||||
};
|
||||
popupService.showConfirm('Opening Browser', message, 'Open', 'Cancel', openBrowser);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue