Last active
September 21, 2019 12:48
-
-
Save minhhungit/702af50333ca65405d01e78514a5af80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constructor() { | |
super(); | |
let sdsAddFileBtn = this.form.Sds.element.find(".add-file-button"); | |
let sdsClickEvt = (e) => { | |
e.preventDefault(); | |
if (Q.trimToNull(Serenity.EditorUtils.getValue(this.form.Sds)) !== null) { | |
Q.confirm("This will overwrite the current file. Are you sure you want to continue?", () => { | |
$(e.target).click(); | |
sdsAddFileBtn.one('click', (e) => sdsClickEvt(e)); | |
}, { onCancel: () => sdsAddFileBtn.one('click', (e) => sdsClickEvt(e)) }); | |
} | |
else { | |
$(e.target).click(); | |
sdsAddFileBtn.one('click', (e) => sdsClickEvt(e)); | |
} | |
}; | |
sdsAddFileBtn.one('click', (e) => sdsClickEvt(e)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment