From cd2f2df303ec62c850ebe55702084d5ea4b73e4f Mon Sep 17 00:00:00 2001 From: Jannat Patel <31363128+pateljannat@users.noreply.github.com> Date: Mon, 14 Aug 2023 10:21:09 +0530 Subject: [PATCH] fix: controls loading for discussions (#22037) --- frappe/public/js/frappe-web.bundle.js | 1 - frappe/templates/discussions/discussions.js | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frappe/public/js/frappe-web.bundle.js b/frappe/public/js/frappe-web.bundle.js index 30cf552c82..36064767fb 100644 --- a/frappe/public/js/frappe-web.bundle.js +++ b/frappe/public/js/frappe-web.bundle.js @@ -24,4 +24,3 @@ import "./bootstrap-4-web.bundle"; import "../../website/js/website.js"; import "./frappe/socketio_client.js"; -import "./frappe/form/controls/control.js"; diff --git a/frappe/templates/discussions/discussions.js b/frappe/templates/discussions/discussions.js index 4b296fbcce..964de63eb3 100644 --- a/frappe/templates/discussions/discussions.js +++ b/frappe/templates/discussions/discussions.js @@ -3,9 +3,11 @@ frappe.ready(() => { add_color_to_avatars(); this.single_thread = $(".is-single-thread").length; - if (this.single_thread) { - make_comment_editor($(".discussion-form .discussions-comment")); - } + frappe.require("controls.bundle.js", () => { + if (this.single_thread) { + make_comment_editor($(".discussion-form .discussions-comment")); + } + }); $(".search-field").keyup((e) => { search_topic(e);