Add missing files changed directive to upload

This commit is contained in:
Sam Chow 2018-06-14 17:18:58 -04:00
parent 68f8eb5a8f
commit b631b0f271
3 changed files with 45 additions and 2 deletions

View file

@ -0,0 +1,18 @@
/**
* Raises the 'filesChanged' event on the scope if a file on the marked <input type="file"> exists.
*/
angular.module('quay-config').directive("filesChanged", [function () {
return {
restrict: 'A',
scope: {
'filesChanged': "&"
},
link: function (scope, element, attributes) {
element.bind("change", function (changeEvent) {
scope.$apply(function() {
scope.filesChanged({'files': changeEvent.target.files});
});
});
}
}
}]);