Conflicts fixed

This commit is contained in:
Matias Pando 2014-09-12 10:24:27 -03:00
commit de43990882
3 changed files with 22 additions and 5 deletions

View file

@ -6,17 +6,16 @@ var bignum = bitcore.Bignum;
var preconditions = require('preconditions').singleton();
angular.module('copayApp.directives')
.directive('validAddress', ['$rootScope', function($rootScope) {
.directive('validAddress', ['$rootScope',
function($rootScope) {
return {
require: 'ngModel',
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) {
if ($rootScope.merchant && $rootScope.merchant.domain && value === $rootScope.merchant.domain) {
ctrl.$setValidity('validAddress', true);
return value;
}
@ -27,6 +26,7 @@ angular.module('copayApp.directives')
return value;
}
// Bip21 uri
if (/^bitcoin:/.test(value)) {
var uri = new bitcore.BIP21(value);
@ -41,11 +41,13 @@ angular.module('copayApp.directives')
return value;
};
ctrl.$parsers.unshift(validator);
ctrl.$formatters.unshift(validator);
}
};
}])
}
])
.directive('enoughAmount', ['$rootScope',
function($rootScope) {
var w = $rootScope.wallet;