From 4e068b2d0ee558c886c2ac3897f996153a9b1e8e Mon Sep 17 00:00:00 2001 From: JDonadio Date: Fri, 20 Jan 2017 14:18:04 -0300 Subject: [PATCH] add border and color --- src/js/controllers/export.js | 13 +++++++++++++ src/sass/views/export.scss | 15 +++++++++++++++ www/views/tab-export-file.html | 6 ++++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/export.js b/src/js/controllers/export.js index 8437663a8..5c9ce8553 100644 --- a/src/js/controllers/export.js +++ b/src/js/controllers/export.js @@ -16,6 +16,17 @@ angular.module('copayApp.controllers').controller('exportController', }, 10); }; + $scope.checkPassword = function(pw1, pw2) { + if (pw1.length > 0) { + if (pw2.length > 0) { + if (pw1 == pw2) $scope.result = 'correct'; + else $scope.result = 'incorrect'; + } else + $scope.result = null; + } else + $scope.result = null; + }; + function getPassword(cb) { if ($scope.password) return cb(null, $scope.password); @@ -57,6 +68,7 @@ angular.module('copayApp.controllers').controller('exportController', var init = function() { $scope.formData = {}; + $scope.formData.password = $scope.formData.repeatpassword = ''; $scope.isEncrypted = wallet.isPrivKeyEncrypted(); $scope.isCordova = platformInfo.isCordova; $scope.isSafari = platformInfo.isSafari; @@ -214,6 +226,7 @@ angular.module('copayApp.controllers').controller('exportController', }; $scope.formData.exportWalletInfo = null; $scope.password = null; + $scope.result = null; }); }); diff --git a/src/sass/views/export.scss b/src/sass/views/export.scss index 61ecfd63d..264d54753 100644 --- a/src/sass/views/export.scss +++ b/src/sass/views/export.scss @@ -12,4 +12,19 @@ border-bottom-width: 2px; border-bottom-color: #172565; } + input[type="password"] { + border: none; + margin-left: -5px; + padding-left: 4px; + &.incorrect { + padding-left: 3px; + border: 1px solid; + color: #C90505; + } + &.correct { + padding-left: 3px; + border: 1px solid; + color: #00901B; + } + } } diff --git a/www/views/tab-export-file.html b/www/views/tab-export-file.html index 931257b83..2d9d9a4dc 100644 --- a/www/views/tab-export-file.html +++ b/www/views/tab-export-file.html @@ -8,12 +8,14 @@