paypro: cleanup a lot of old code and comments. minor fixes.

This commit is contained in:
Christopher Jeffrey 2014-08-01 19:49:39 -07:00 committed by Manuel Araoz
commit 3b550d853f
3 changed files with 9 additions and 35 deletions

View file

@ -14,8 +14,6 @@ angular.module('copayApp.directives')
var validator = function(value) {
var uri = copay.HDPath.parseBitcoinURI(value);
window._rootScope = scope;
// Is this a payment protocol URI (BIP-72)?
if (uri && uri.merchant) {
scope.wallet.fetchPaymentTx(uri.merchant, function(err, merchantData) {
@ -46,9 +44,6 @@ angular.module('copayApp.directives')
// XXX There needs to be a better way to do this:
total = +total / config.unitToSatoshi;
var sendForm = angular.element(
document.getElementsByName('sendForm')[0]);
var address = angular.element(
document.querySelector('input#address'));
@ -81,12 +76,10 @@ angular.module('copayApp.directives')
sendall.attr('class', sendall.attr('class') + ' hidden');
// Reset all the changes from the payment protocol weirdness.
// XXX use ng-change attr instead
//address.attr('ng-change', 'ppChange()');
//scope.ppChange = scope.ppChange || function() {
//address.on('change', function(ev) {
scope.$on('change', function(ev) {
//scope.$watch('address', function(newValue, oldValue) {
scope.$watch('address', function(newValue, oldValue) {
var val = address.val();
var uri = copay.HDPath.parseBitcoinURI(val || '');
if (!uri || !uri.merchant) {
@ -111,7 +104,6 @@ angular.module('copayApp.directives')
// TODO: Check paymentRequest expiration,
// delete if beyond expiration date.
//};
//});
});
//scope.$apply(); // scope.$digest();
@ -120,9 +112,11 @@ angular.module('copayApp.directives')
scope.sendForm.$valid = true;
scope.sendForm.$invalid = false;
scope.sendForm.$pristine = true;
scope.sendForm.address.$valid = true;
scope.sendForm.address.$invalid = false;
scope.sendForm.address.$pristine = true;
scope.sendForm.amount.$valid = true;
scope.sendForm.amount.$invalid = false;
scope.sendForm.amount.$pristine = true;