paypro: implement short merchant names in address box and side box.
This commit is contained in:
parent
20a30609b8
commit
953ff985d8
3 changed files with 35 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.directives')
|
||||
.directive('validAddress', function() {
|
||||
.directive('validAddress', ['$rootScope', function($rootScope) {
|
||||
var bitcore = require('bitcore');
|
||||
var Address = bitcore.Address;
|
||||
var bignum = bitcore.Bignum;
|
||||
|
|
@ -11,6 +11,14 @@ angular.module('copayApp.directives')
|
|||
link: function(scope, elem, attrs, ctrl) {
|
||||
var validator = function(value) {
|
||||
|
||||
// If we're setting the domain, ignore the change.
|
||||
if ($rootScope.merchant
|
||||
&& $rootScope.merchant.domain
|
||||
&& value === $rootScope.merchant.domain) {
|
||||
ctrl.$setValidity('validAddress', true);
|
||||
return value;
|
||||
}
|
||||
|
||||
// Regular url
|
||||
if (/^https?:\/\//.test(value)) {
|
||||
ctrl.$setValidity('validAddress', true);
|
||||
|
|
@ -35,7 +43,7 @@ angular.module('copayApp.directives')
|
|||
ctrl.$formatters.unshift(validator);
|
||||
}
|
||||
};
|
||||
})
|
||||
}])
|
||||
.directive('enoughAmount', ['$rootScope',
|
||||
function($rootScope) {
|
||||
var bitcore = require('bitcore');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue