diff --git a/src/css/ionic-migration.css b/src/css/ionic-migration.css
index bd311bb26..58c49a4b3 100644
--- a/src/css/ionic-migration.css
+++ b/src/css/ionic-migration.css
@@ -43,6 +43,15 @@
font-size: 16px;
}
+.popover, .popover .bar-header {
+ border-radius: 10px;
+}
+
+.popover {
+ height: auto;
+ width: 200px;
+}
+
.popup-container.active .popup {
border-radius: 10px;
}
diff --git a/src/js/controllers/modals/txDetails.js b/src/js/controllers/modals/txDetails.js
index aac60fd59..205ba17fd 100644
--- a/src/js/controllers/modals/txDetails.js
+++ b/src/js/controllers/modals/txDetails.js
@@ -85,9 +85,9 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
return n.substring(0, 4);
};
- $scope.copyToClipboard = function(addr) {
+ $scope.copyToClipboard = function(addr, $event) {
if (!addr) return;
- self.copyToClipboard(addr);
+ self.copyToClipboard(addr, $event);
};
$scope.cancel = function() {
diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js
index 0dfb585a2..710a6e314 100644
--- a/src/js/controllers/modals/txpDetails.js
+++ b/src/js/controllers/modals/txpDetails.js
@@ -227,9 +227,9 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
});
};
- $scope.copyToClipboard = function(addr) {
+ $scope.copyToClipboard = function(addr, $event) {
if (!addr) return;
- self.copyToClipboard(addr);
+ self.copyToClipboard(addr, $event);
};
$scope.close = function(txp) {
diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js
index 05bfc5dc9..4a720fc6b 100644
--- a/src/js/controllers/walletHome.js
+++ b/src/js/controllers/walletHome.js
@@ -1,6 +1,6 @@
'use strict';
-angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, notification, txStatus, profileService, lodash, configService, rateService, storageService, bitcore, gettext, gettextCatalog, platformInfo, addressService, ledger, bwcError, confirmDialog, txFormatService, addressbookService, go, feeService, walletService, fingerprintService, nodeWebkit, ongoingProcess) {
+angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, notification, txStatus, profileService, lodash, configService, rateService, storageService, bitcore, gettext, gettextCatalog, platformInfo, addressService, ledger, bwcError, confirmDialog, txFormatService, addressbookService, go, feeService, walletService, fingerprintService, nodeWebkit, ongoingProcess) {
var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP;
@@ -200,12 +200,36 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
});
};
- this.copyToClipboard = function(addr) {
+ this.copyToClipboard = function(addr, $event) {
+
+ var showPopover = function() {
+
+ $ionicPopover.fromTemplateUrl('views/includes/copyToClipboard.html', {
+ scope: $scope
+ }).then(function(popover) {
+ $scope.popover = popover;
+ $scope.popover.show($event);
+ });
+
+ $scope.close = function() {
+ $scope.popover.hide();
+ }
+
+ $timeout(function() {
+ $scope.popover.hide(); //close the popover after 0.7 seconds
+ }, 700);
+
+ $scope.$on('$destroy', function() {
+ $scope.popover.remove();
+ });
+ };
+
if (isCordova) {
window.cordova.plugins.clipboard.copy(addr);
window.plugins.toast.showShortCenter(gettextCatalog.getString('Copied to clipboard'));
} else if (platformInfo.isNW) {
nodeWebkit.writeToClipboard(addr);
+ showPopover($event);
}
};