Fixes #3419 - Unable to close sidebar in ticket create screen after ticket split.
This commit is contained in:
parent
e5dc99deea
commit
0313f8ee21
12 changed files with 28 additions and 28 deletions
|
@ -82,9 +82,13 @@ class App.Controller extends Spine.Controller
|
|||
@el.empty()
|
||||
|
||||
# release spine bindings (see release() of spine.coffee)
|
||||
@off()
|
||||
@unbind()
|
||||
@stopListening()
|
||||
|
||||
release: ->
|
||||
# nothing
|
||||
|
||||
abortAjaxCalls: =>
|
||||
if !@ajaxCalls
|
||||
return
|
||||
|
@ -96,11 +100,6 @@ class App.Controller extends Spine.Controller
|
|||
for callId in idsToCancel
|
||||
App.Ajax.abort(callId)
|
||||
|
||||
# release Spine's event handling
|
||||
release: ->
|
||||
@off()
|
||||
@stopListening()
|
||||
|
||||
# add @title method to set title
|
||||
title: (name, translate = false) ->
|
||||
# $('html head title').html(@Config.get(product_name) + ' - ' + App.i18n.translateInline(name))
|
||||
|
|
|
@ -47,7 +47,7 @@ class App.ControllerGenericIndex extends App.Controller
|
|||
|
||||
release: =>
|
||||
if @subscribeId
|
||||
App[ @genericObject ].unsubscribe(@subscribeId)
|
||||
App[@genericObject].unsubscribe(@subscribeId)
|
||||
|
||||
paginate: (page) =>
|
||||
return if page is @pageData.pagerSelected
|
||||
|
|
|
@ -50,7 +50,6 @@ class App.ManageKnowledgeBase extends App.ControllerTabs
|
|||
@fetchAndRender()
|
||||
|
||||
release: ->
|
||||
super
|
||||
@modal?.el.remove()
|
||||
|
||||
processLoaded: ->
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
class App.TicketCreateSidebar extends App.Controller
|
||||
constructor: ->
|
||||
super
|
||||
class App.TicketCreateSidebar
|
||||
constructor: (options) ->
|
||||
for key, value of options
|
||||
@[key] = value
|
||||
|
||||
@render()
|
||||
|
||||
reload: (args) =>
|
||||
|
@ -40,7 +42,10 @@ class App.TicketCreateSidebar extends App.Controller
|
|||
)
|
||||
@sidebarItems.push @sidebarBackends[key]
|
||||
|
||||
new App.Sidebar(
|
||||
if @sidebar
|
||||
@sidebar.releaseController()
|
||||
|
||||
@sidebar = new App.Sidebar(
|
||||
el: @el
|
||||
sidebarState: @sidebarState
|
||||
items: @sidebarItems
|
||||
|
|
|
@ -79,7 +79,6 @@ class Api extends App.ControllerSubContent
|
|||
|
||||
|
||||
release: =>
|
||||
super
|
||||
if @subscribeApplicationId
|
||||
App.Application.unsubscribe(@subscribeApplicationId)
|
||||
|
||||
|
|
|
@ -603,7 +603,6 @@ class ChatWindow extends App.Controller
|
|||
release: =>
|
||||
@trigger('closed')
|
||||
@el.remove()
|
||||
super
|
||||
|
||||
clearUnread: =>
|
||||
@$('.chat-message--new').removeClass('chat-message--new')
|
||||
|
|
|
@ -89,9 +89,6 @@ class App.Dashboard extends App.Controller
|
|||
changed: ->
|
||||
false
|
||||
|
||||
release: ->
|
||||
# no
|
||||
|
||||
toggle: (e) =>
|
||||
@$('.tabs .tab').removeClass('active')
|
||||
$(e.target).addClass('active')
|
||||
|
|
|
@ -47,8 +47,11 @@ class App.TicketZoomSidebar extends App.ControllerObserver
|
|||
)
|
||||
@sidebarItems.push @sidebarBackends[key]
|
||||
|
||||
new App.Sidebar(
|
||||
el: @el.find('.tabsSidebar')
|
||||
if @sidebar
|
||||
@sidebar.releaseController()
|
||||
|
||||
@sidebar = new App.Sidebar(
|
||||
el: @$('.tabsSidebar')
|
||||
sidebarState: @sidebarState
|
||||
items: @sidebarItems
|
||||
)
|
||||
|
|
|
@ -5,7 +5,7 @@ class App.TaskbarWatcher extends App.Controller
|
|||
App.TaskManager.preferencesTrigger(@taskKey)
|
||||
|
||||
release: =>
|
||||
return if !@subscribeId
|
||||
if @subscribeId
|
||||
App.TaskManager.preferencesUnsubscribe(@subscribeId)
|
||||
|
||||
render: (preferences) =>
|
||||
|
|
|
@ -63,7 +63,6 @@ class App.OnlineNotificationWidget extends App.Controller
|
|||
release: ->
|
||||
$(window).off 'click.notifications'
|
||||
$(window).off 'keydown.notifications'
|
||||
super
|
||||
|
||||
access: ->
|
||||
return false if !@Session.get()
|
||||
|
|
|
@ -10,6 +10,7 @@ class App.Sidebar extends App.Controller
|
|||
|
||||
constructor: ->
|
||||
super
|
||||
|
||||
@render()
|
||||
|
||||
# get active tab by name
|
||||
|
@ -61,7 +62,7 @@ class App.Sidebar extends App.Controller
|
|||
type: 'small'
|
||||
)
|
||||
|
||||
@html localEl
|
||||
@html(localEl)
|
||||
|
||||
badgeRender: (el, item) =>
|
||||
@badgeEl = el
|
||||
|
@ -76,19 +77,18 @@ class App.Sidebar extends App.Controller
|
|||
|
||||
toggleSidebar: =>
|
||||
@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')
|
||||
|
||||
showSidebar: ->
|
||||
showSidebar: =>
|
||||
@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')
|
||||
|
||||
toggleTab: (e) =>
|
||||
|
||||
# get selected tab
|
||||
name = $(e.target).closest('.tabsSidebar-tab').data('tab')
|
||||
|
||||
if name
|
||||
|
||||
# if current tab is selected again, toggle side bar
|
||||
|
@ -99,7 +99,7 @@ class App.Sidebar extends App.Controller
|
|||
else
|
||||
@toggleTabAction(name)
|
||||
|
||||
toggleTabAction: (name) ->
|
||||
toggleTabAction: (name) =>
|
||||
return if !name
|
||||
|
||||
# remember sidebarState for outsite
|
||||
|
|
|
@ -6,7 +6,7 @@ class App.UpdateTastbar extends App.Controller
|
|||
@subscribeId = @genericObject.subscribe(@update)
|
||||
|
||||
release: =>
|
||||
App[ @genericObject.constructor.className ].unsubscribe(@subscribeId)
|
||||
App[@genericObject.constructor.className].unsubscribe(@subscribeId)
|
||||
|
||||
update: (genericObject) =>
|
||||
|
||||
|
|
Loading…
Reference in a new issue