From cfe563e515bcb12714bbb34cfd787069d72e794b Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 15 Aug 2022 14:36:42 +0200 Subject: [PATCH] FIX: use native javascript instead of jquery --- .../discourse/controllers/admin-wizards-manager.js.es6 | 6 +++--- .../discourse/templates/admin-wizards-manager.hbs | 8 ++++---- assets/stylesheets/common/wizard-manager.scss | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 b/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 index 7228d164..719abff0 100644 --- a/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 @@ -68,7 +68,7 @@ export default Controller.extend({ file: null, filename: null, }); - $("#file-upload").val(""); + document.getElementById('custom-wizard-file-upload').value = ''; }, @observes("importing", "destroying") @@ -83,7 +83,7 @@ export default Controller.extend({ actions: { upload() { - $("#file-upload").click(); + document.getElementById('custom-wizard-file-upload').click(); }, clearFile() { @@ -102,7 +102,7 @@ export default Controller.extend({ if (maxFileSize < file.size) { this.setMessage("error", "file_size_error"); this.set("file", null); - $("#file-upload").val(""); + document.getElementById('custom-wizard-file-upload').value = ''; } else { this.setProperties({ file, diff --git a/assets/javascripts/discourse/templates/admin-wizards-manager.hbs b/assets/javascripts/discourse/templates/admin-wizards-manager.hbs index 1741f30f..4b91bd3d 100644 --- a/assets/javascripts/discourse/templates/admin-wizards-manager.hbs +++ b/assets/javascripts/discourse/templates/admin-wizards-manager.hbs @@ -11,11 +11,11 @@ {{/if}} - + input=(action "setFile")}} {{d-button id="upload-button" label="admin.wizard.manager.upload" diff --git a/assets/stylesheets/common/wizard-manager.scss b/assets/stylesheets/common/wizard-manager.scss index a3b30c98..b8df732f 100644 --- a/assets/stylesheets/common/wizard-manager.scss +++ b/assets/stylesheets/common/wizard-manager.scss @@ -26,7 +26,7 @@ } } - #file-upload { + #custom-wizard-file-upload { display: none; }