Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 8da6474

Browse files
BoykoAlexghillert
authored andcommitted
Clear input file value after file is uploaded
1 parent 594b687 commit 8da6474

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ui/app/scripts/directives.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,5 +382,16 @@ define(['angular', 'xregexp', 'moment'], function(angular) {
382382
});
383383
}
384384
};
385+
})
386+
.directive('clearSelectedFile', function () {
387+
return {
388+
restrict: 'A',
389+
scope: false,
390+
link: function(scope, element) {
391+
element.bind('change', function() {
392+
element.val(null);
393+
});
394+
}
395+
};
385396
});
386397
});

ui/app/scripts/task/views/bulk-define-tasks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h1>Bulk Define Tasks</h1>
3636
<label type="button" class="btn btn-default" tooltip-placement="top"
3737
tooltip="Select a file from local file system to import its contents into the DSL editor">
3838
<span class="glyphicon glyphicon-file"></span>
39-
<input type="file" on-read-file="displayFileContents(contents)" style="display:none;"/>
39+
<input type="file" on-read-file="displayFileContents(contents)" clear-selected-file style="display:none;"/>
4040
Import File
4141
</label>
4242
<label class="btn btn-default" tooltip-placement="top"

0 commit comments

Comments
 (0)