diff --git a/app/assets/javascripts/app/controllers/_manage/knowledge_base.coffee b/app/assets/javascripts/app/controllers/_manage/knowledge_base.coffee index 632ddfc33..337cc40f4 100644 --- a/app/assets/javascripts/app/controllers/_manage/knowledge_base.coffee +++ b/app/assets/javascripts/app/controllers/_manage/knowledge_base.coffee @@ -49,6 +49,10 @@ class App.ManageKnowledgeBase extends App.ControllerTabs App.KnowledgeBase.find(@knowledge_base_id).remove(clear: true) @fetchAndRender() + release: -> + super + @modal.el.remove() + processLoaded: -> if @knowledge_base_id @renderLoaded() @@ -59,7 +63,7 @@ class App.ManageKnowledgeBase extends App.ControllerTabs @renderScreenError(detail: 'No Knowledge Base. Please create first Knowledge Base', el: @$('.page-content')) @headerSwitchInput.prop('checked', false) - new App.KnowledgeBaseNewModal( + @modal = new App.KnowledgeBaseNewModal( parentVC: @ container: @el.closest('.main') ) diff --git a/app/assets/javascripts/app/views/knowledge_base/new_modal.coffee b/app/assets/javascripts/app/views/knowledge_base/new_modal.coffee index 830f3b27b..3dbb91fd8 100644 --- a/app/assets/javascripts/app/views/knowledge_base/new_modal.coffee +++ b/app/assets/javascripts/app/views/knowledge_base/new_modal.coffee @@ -46,6 +46,7 @@ class App.KnowledgeBaseNewModal extends App.ControllerModal success: (data) => @parentVC.fetchAndRender() + @parentVC.modal = undefined @close() error: (xhr) =>