From e9a6f40aafb80d008ff5216d4d6ea90da5aba28a Mon Sep 17 00:00:00 2001 From: Navin Karkera Date: Tue, 22 Oct 2024 20:59:43 +0530 Subject: [PATCH] fix: insert alert before modal-header Some blocks hide modal-header div to insert custom-tabs, so injecting alert inside modal-header does not work. Injecting it before this header works for all cases. --- cms/static/js/views/modals/edit_xblock.js | 2 +- cms/templates/js/basic-modal.underscore | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cms/static/js/views/modals/edit_xblock.js b/cms/static/js/views/modals/edit_xblock.js index 327dec4bcaa9..3b5a77352e70 100644 --- a/cms/static/js/views/modals/edit_xblock.js +++ b/cms/static/js/views/modals/edit_xblock.js @@ -76,7 +76,7 @@ function($, _, Backbone, gettext, BaseModal, ViewUtils, XBlockViewUtils, XBlockE }, createWarningToast: function(upstreamLink) { - this.$('.modal-window-alerts').html(this.loadTemplate('edit-upstream-alert')({ + this.$('.modal-header').before(this.loadTemplate('edit-upstream-alert')({ upstreamLink: upstreamLink, })); }, diff --git a/cms/templates/js/basic-modal.underscore b/cms/templates/js/basic-modal.underscore index 1adcf1b3b5b7..4273fe4f9956 100644 --- a/cms/templates/js/basic-modal.underscore +++ b/cms/templates/js/basic-modal.underscore @@ -5,8 +5,6 @@