Wallet information: enables copy to clipboard on mobile

This commit is contained in:
Gustavo Maximiliano Cortez 2016-07-11 18:06:43 -03:00
commit ebb62824e2
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
2 changed files with 14 additions and 6 deletions

View file

@ -1,13 +1,14 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesInformation',
function($scope, $log, $timeout, platformInfo, gettextCatalog, lodash, profileService, storageService, configService, go, bitcore) {
function($scope, $log, $timeout, platformInfo, gettextCatalog, lodash, profileService, configService, go) {
var base = 'xpub';
var fc = profileService.focusedClient;
var c = fc.credentials;
var walletId = c.walletId;
var config = configService.getSync();
var b = 1;
var isCordova = platformInfo.isCordova;
config.colorFor = config.colorFor || {};
$scope.init = function() {
@ -109,6 +110,13 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
if (b != 5) return b++;
save('#202020');
}
};
$scope.copyToClipboard = function(data) {
if (isCordova) {
window.cordova.plugins.clipboard.copy(data);
window.plugins.toast.showShortCenter(gettextCatalog.getString('Copied to clipboard'));
}
};
});