Fixes #2784 - new Knowledge Base modal in settings is removed properly when moving to another setting tab

This commit is contained in:
Mantas Masalskis 2019-11-13 11:30:16 +01:00 committed by Martin Edenhofer
parent 5ca41c8389
commit 6d684c74cf
2 changed files with 6 additions and 1 deletions

View file

@ -49,6 +49,10 @@ class App.ManageKnowledgeBase extends App.ControllerTabs
App.KnowledgeBase.find(@knowledge_base_id).remove(clear: true) App.KnowledgeBase.find(@knowledge_base_id).remove(clear: true)
@fetchAndRender() @fetchAndRender()
release: ->
super
@modal.el.remove()
processLoaded: -> processLoaded: ->
if @knowledge_base_id if @knowledge_base_id
@renderLoaded() @renderLoaded()
@ -59,7 +63,7 @@ class App.ManageKnowledgeBase extends App.ControllerTabs
@renderScreenError(detail: 'No Knowledge Base. Please create first Knowledge Base', el: @$('.page-content')) @renderScreenError(detail: 'No Knowledge Base. Please create first Knowledge Base', el: @$('.page-content'))
@headerSwitchInput.prop('checked', false) @headerSwitchInput.prop('checked', false)
new App.KnowledgeBaseNewModal( @modal = new App.KnowledgeBaseNewModal(
parentVC: @ parentVC: @
container: @el.closest('.main') container: @el.closest('.main')
) )

View file

@ -46,6 +46,7 @@ class App.KnowledgeBaseNewModal extends App.ControllerModal
success: (data) => success: (data) =>
@parentVC.fetchAndRender() @parentVC.fetchAndRender()
@parentVC.modal = undefined
@close() @close()
error: (xhr) => error: (xhr) =>