Skip to content

Commit

Permalink
Merge pull request #15 from unicef-polymer/fire-change-unsaved-file
Browse files Browse the repository at this point in the history
Fire change-unsaved-file event
  • Loading branch information
acory authored Nov 6, 2018
2 parents 54f7d22 + 09d2ab3 commit d832567
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions etools-upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@
return;
}

this._fireChangeFileEventIfApplicable();

this.resetStatus();
this.resetValidations();

Expand All @@ -252,6 +254,13 @@
}
}

_fireChangeFileEventIfApplicable() {
if (this.fileUrl && !isNaN(this.fileUrl)) {
// if fileUrl is a number , then the previous upload was not saved
this.fireEvent('change-unsaved-file');
}
}

_handleUpload() {
this.uploadInProgress = true;
this.fireEvent('upload-started');
Expand Down

0 comments on commit d832567

Please sign in to comment.