Add missing files changed directive to upload
This commit is contained in:
parent
68f8eb5a8f
commit
b631b0f271
3 changed files with 45 additions and 2 deletions
18
config_app/js/components/files-changed.js
Normal file
18
config_app/js/components/files-changed.js
Normal 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});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}]);
|
Reference in a new issue