Added spinner to all buttons

This commit is contained in:
Gustavo Cortez 2014-04-24 22:43:19 -03:00
commit 872cfaba68
8 changed files with 52 additions and 18 deletions

View file

@ -58,5 +58,22 @@ angular.module('copay.directives')
}
};
}])
.directive('loading', function () {
return {
restrict: 'A',
link: function (scope, element, attr) {
var a = element.html();
var text = attr.loading;
scope.$watch('loading', function (val) {
if (val) {
element.html('<img src="img/loading.gif"> ' + text + '...' );
}
else {
element.html(a);
}
});
}
}
})
;