diff --git a/frappe/public/js/frappe/file_uploader/FileUploader.vue b/frappe/public/js/frappe/file_uploader/FileUploader.vue index eba6bf1b2a..6d082b640e 100644 --- a/frappe/public/js/frappe/file_uploader/FileUploader.vue +++ b/frappe/public/js/frappe/file_uploader/FileUploader.vue @@ -608,7 +608,8 @@ defineExpose({ add_files, upload_files, toggle_all_private, - wrapper_ready + wrapper_ready, + close_dialog, }); diff --git a/frappe/public/js/frappe/file_uploader/file_uploader.bundle.js b/frappe/public/js/frappe/file_uploader/file_uploader.bundle.js index 7834c8adb1..f9134f10fa 100644 --- a/frappe/public/js/frappe/file_uploader/file_uploader.bundle.js +++ b/frappe/public/js/frappe/file_uploader/file_uploader.bundle.js @@ -1,5 +1,6 @@ import { createApp } from "vue"; import FileUploaderComponent from "./FileUploader.vue"; +import { watch } from "vue"; class FileUploader { constructor({ @@ -52,8 +53,8 @@ class FileUploader { this.uploader.wrapper_ready = true; } - this.uploader.$watch( - "files", + watch( + () => this.uploader.files, (files) => { let all_private = files.every((file) => file.private); if (this.dialog) { @@ -65,27 +66,36 @@ class FileUploader { { deep: true } ); - this.uploader.$watch("trigger_upload", (trigger_upload) => { - if (trigger_upload) { - this.upload_files(); + watch( + () => this.uploader.trigger_upload, + (trigger_upload) => { + if (trigger_upload) { + this.upload_files(); + } } - }); + ); - this.uploader.$watch("close_dialog", (close_dialog) => { - if (close_dialog) { - this.dialog && this.dialog.hide(); + watch( + () => this.uploader.close_dialog, + (close_dialog) => { + if (close_dialog) { + this.dialog && this.dialog.hide(); + } } - }); + ); - this.uploader.$watch("hide_dialog_footer", (hide_dialog_footer) => { - if (hide_dialog_footer) { - this.dialog && this.dialog.footer.addClass("hide"); - this.dialog.$wrapper.data("bs.modal")._config.backdrop = "static"; - } else { - this.dialog && this.dialog.footer.removeClass("hide"); - this.dialog.$wrapper.data("bs.modal")._config.backdrop = true; + watch( + () => this.uploader.hide_dialog_footer, + (hide_dialog_footer) => { + if (hide_dialog_footer) { + this.dialog && this.dialog.footer.addClass("hide"); + this.dialog.$wrapper.data("bs.modal")._config.backdrop = "static"; + } else { + this.dialog && this.dialog.footer.removeClass("hide"); + this.dialog.$wrapper.data("bs.modal")._config.backdrop = true; + } } - }); + ); if (files && files.length) { this.uploader.add_files(files); diff --git a/frappe/public/js/print_format_builder/print_format_builder.bundle.js b/frappe/public/js/print_format_builder/print_format_builder.bundle.js index 62535fd1cf..45a6dd91cc 100644 --- a/frappe/public/js/print_format_builder/print_format_builder.bundle.js +++ b/frappe/public/js/print_format_builder/print_format_builder.bundle.js @@ -1,4 +1,4 @@ -import { createApp } from "vue"; +import { createApp, watch } from "vue"; import PrintFormatBuilderComponent from "./PrintFormatBuilder.vue"; class PrintFormatBuilder { @@ -32,8 +32,8 @@ class PrintFormatBuilder { SetVueGlobals(app); this.$component = app.mount(this.$wrapper.get(0)); - this.$component.$watch( - "$store.dirty", + watch( + () => this.$component.$store.dirty, (dirty) => { if (dirty.value) { this.page.set_indicator("Not Saved", "orange"); @@ -48,9 +48,12 @@ class PrintFormatBuilder { { deep: true } ); - this.$component.$watch("show_preview", (value) => { - $toggle_preview_btn.text(value ? __("Hide Preview") : __("Show Preview")); - }); + watch( + () => this.$component.show_preview, + (value) => { + $toggle_preview_btn.text(value ? __("Hide Preview") : __("Show Preview")); + } + ); } }