Skip to content

Commit

Permalink
always clear fileUploadPreview directive element on preview change
Browse files Browse the repository at this point in the history
  • Loading branch information
danxshap committed Jan 19, 2014
1 parent 41d2b2d commit 9125ee7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/jquery.fileupload-angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
})

// The FileUploadController initializes the fileupload widget and
// provides scope methods to control the File Upload functionality:
// provides scope methods to control the File Upload functionality:
.controller('FileUploadController', [
'$scope', '$element', '$attrs', '$window', 'fileUpload',
function ($scope, $element, $attrs, $window, fileUpload) {
Expand Down Expand Up @@ -377,8 +377,9 @@
$scope.$watch(
$attrs.fileUploadPreview + '.preview',
function (preview) {
$element.empty();
if (preview) {
$element.empty().append(preview);
$element.append(preview);
}
}
);
Expand Down

0 comments on commit 9125ee7

Please sign in to comment.