Fixes #3419 - Unable to close sidebar in ticket create screen after ticket split.

This commit is contained in:
Martin Edenhofer 2021-03-02 07:32:23 +00:00 committed by Thorsten Eckel
parent e5dc99deea
commit 0313f8ee21
12 changed files with 28 additions and 28 deletions

View file

@ -82,9 +82,13 @@ class App.Controller extends Spine.Controller
@el.empty() @el.empty()
# release spine bindings (see release() of spine.coffee) # release spine bindings (see release() of spine.coffee)
@off()
@unbind() @unbind()
@stopListening() @stopListening()
release: ->
# nothing
abortAjaxCalls: => abortAjaxCalls: =>
if !@ajaxCalls if !@ajaxCalls
return return
@ -96,11 +100,6 @@ class App.Controller extends Spine.Controller
for callId in idsToCancel for callId in idsToCancel
App.Ajax.abort(callId) App.Ajax.abort(callId)
# release Spine's event handling
release: ->
@off()
@stopListening()
# add @title method to set title # add @title method to set title
title: (name, translate = false) -> title: (name, translate = false) ->
# $('html head title').html(@Config.get(product_name) + ' - ' + App.i18n.translateInline(name)) # $('html head title').html(@Config.get(product_name) + ' - ' + App.i18n.translateInline(name))

View file

@ -50,7 +50,6 @@ class App.ManageKnowledgeBase extends App.ControllerTabs
@fetchAndRender() @fetchAndRender()
release: -> release: ->
super
@modal?.el.remove() @modal?.el.remove()
processLoaded: -> processLoaded: ->

View file

@ -1,6 +1,8 @@
class App.TicketCreateSidebar extends App.Controller class App.TicketCreateSidebar
constructor: -> constructor: (options) ->
super for key, value of options
@[key] = value
@render() @render()
reload: (args) => reload: (args) =>
@ -40,7 +42,10 @@ class App.TicketCreateSidebar extends App.Controller
) )
@sidebarItems.push @sidebarBackends[key] @sidebarItems.push @sidebarBackends[key]
new App.Sidebar( if @sidebar
@sidebar.releaseController()
@sidebar = new App.Sidebar(
el: @el el: @el
sidebarState: @sidebarState sidebarState: @sidebarState
items: @sidebarItems items: @sidebarItems

View file

@ -79,7 +79,6 @@ class Api extends App.ControllerSubContent
release: => release: =>
super
if @subscribeApplicationId if @subscribeApplicationId
App.Application.unsubscribe(@subscribeApplicationId) App.Application.unsubscribe(@subscribeApplicationId)

View file

@ -603,7 +603,6 @@ class ChatWindow extends App.Controller
release: => release: =>
@trigger('closed') @trigger('closed')
@el.remove() @el.remove()
super
clearUnread: => clearUnread: =>
@$('.chat-message--new').removeClass('chat-message--new') @$('.chat-message--new').removeClass('chat-message--new')

View file

@ -89,9 +89,6 @@ class App.Dashboard extends App.Controller
changed: -> changed: ->
false false
release: ->
# no
toggle: (e) => toggle: (e) =>
@$('.tabs .tab').removeClass('active') @$('.tabs .tab').removeClass('active')
$(e.target).addClass('active') $(e.target).addClass('active')

View file

@ -47,8 +47,11 @@ class App.TicketZoomSidebar extends App.ControllerObserver
) )
@sidebarItems.push @sidebarBackends[key] @sidebarItems.push @sidebarBackends[key]
new App.Sidebar( if @sidebar
el: @el.find('.tabsSidebar') @sidebar.releaseController()
@sidebar = new App.Sidebar(
el: @$('.tabsSidebar')
sidebarState: @sidebarState sidebarState: @sidebarState
items: @sidebarItems items: @sidebarItems
) )

View file

@ -5,7 +5,7 @@ class App.TaskbarWatcher extends App.Controller
App.TaskManager.preferencesTrigger(@taskKey) App.TaskManager.preferencesTrigger(@taskKey)
release: => release: =>
return if !@subscribeId if @subscribeId
App.TaskManager.preferencesUnsubscribe(@subscribeId) App.TaskManager.preferencesUnsubscribe(@subscribeId)
render: (preferences) => render: (preferences) =>

View file

@ -63,7 +63,6 @@ class App.OnlineNotificationWidget extends App.Controller
release: -> release: ->
$(window).off 'click.notifications' $(window).off 'click.notifications'
$(window).off 'keydown.notifications' $(window).off 'keydown.notifications'
super
access: -> access: ->
return false if !@Session.get() return false if !@Session.get()

View file

@ -10,6 +10,7 @@ class App.Sidebar extends App.Controller
constructor: -> constructor: ->
super super
@render() @render()
# get active tab by name # get active tab by name
@ -61,7 +62,7 @@ class App.Sidebar extends App.Controller
type: 'small' type: 'small'
) )
@html localEl @html(localEl)
badgeRender: (el, item) => badgeRender: (el, item) =>
@badgeEl = el @badgeEl = el
@ -76,19 +77,18 @@ class App.Sidebar extends App.Controller
toggleSidebar: => toggleSidebar: =>
@el.parent().find('.tabsSidebar-sidebarSpacer').toggleClass('is-closed') @el.parent().find('.tabsSidebar-sidebarSpacer').toggleClass('is-closed')
@el.parent().find('.tabsSidebar').toggleClass('is-closed') @el.filter('.tabsSidebar').toggleClass('is-closed')
#@el.parent().next('.attributeBar').toggleClass('is-closed') #@el.parent().next('.attributeBar').toggleClass('is-closed')
showSidebar: -> showSidebar: =>
@el.parent().find('.tabsSidebar-sidebarSpacer').removeClass('is-closed') @el.parent().find('.tabsSidebar-sidebarSpacer').removeClass('is-closed')
@el.parent().find('.tabsSidebar').removeClass('is-closed') @el.filter('.tabsSidebar').removeClass('is-closed')
#@el.parent().next('.attributeBar').addClass('is-closed') #@el.parent().next('.attributeBar').addClass('is-closed')
toggleTab: (e) => toggleTab: (e) =>
# get selected tab # get selected tab
name = $(e.target).closest('.tabsSidebar-tab').data('tab') name = $(e.target).closest('.tabsSidebar-tab').data('tab')
if name if name
# if current tab is selected again, toggle side bar # if current tab is selected again, toggle side bar
@ -99,7 +99,7 @@ class App.Sidebar extends App.Controller
else else
@toggleTabAction(name) @toggleTabAction(name)
toggleTabAction: (name) -> toggleTabAction: (name) =>
return if !name return if !name
# remember sidebarState for outsite # remember sidebarState for outsite