0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00

FIX: use native javascript instead of jquery

Dieser Commit ist enthalten in:
Angus McLeod 2022-08-15 14:36:42 +02:00
Ursprung eae5fbbbb8
Commit cfe563e515
3 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -68,7 +68,7 @@ export default Controller.extend({
file: null, file: null,
filename: null, filename: null,
}); });
$("#file-upload").val(""); document.getElementById('custom-wizard-file-upload').value = '';
}, },
@observes("importing", "destroying") @observes("importing", "destroying")
@ -83,7 +83,7 @@ export default Controller.extend({
actions: { actions: {
upload() { upload() {
$("#file-upload").click(); document.getElementById('custom-wizard-file-upload').click();
}, },
clearFile() { clearFile() {
@ -102,7 +102,7 @@ export default Controller.extend({
if (maxFileSize < file.size) { if (maxFileSize < file.size) {
this.setMessage("error", "file_size_error"); this.setMessage("error", "file_size_error");
this.set("file", null); this.set("file", null);
$("#file-upload").val(""); document.getElementById('custom-wizard-file-upload').value = '';
} else { } else {
this.setProperties({ this.setProperties({
file, file,

Datei anzeigen

@ -11,11 +11,11 @@
</div> </div>
{{/if}} {{/if}}
<Input {{input
id="file-upload" id="custom-wizard-file-upload"
@type="file" type="file"
accept="application/json" accept="application/json"
{{on "input" (action "setFile" value="target.value")}} /> input=(action "setFile")}}
{{d-button {{d-button
id="upload-button" id="upload-button"
label="admin.wizard.manager.upload" label="admin.wizard.manager.upload"

Datei anzeigen

@ -26,7 +26,7 @@
} }
} }
#file-upload { #custom-wizard-file-upload {
display: none; display: none;
} }