From b50698c771fbf0a1643c71de63a9c056e52c1d47 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 15 Sep 2014 23:35:27 +0200 Subject: [PATCH] Fixed tabsSidebar --- .../_application_controller_generic.js.coffee | 9 +++---- .../app/controllers/layout_ref.js.coffee | 24 +++++++++---------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee index a7b4b4dbd..da56c7ee0 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee @@ -439,12 +439,13 @@ class App.Sidebar extends App.Controller item.callback( @el.find( '.sidebar-content[data-content=' + item.name + ']' ) ) toggleSidebar: -> - $('.content.active .tabsSidebarSpace').toggleClass('is-closed') - $('.content.active .tabsSidebar').toggleClass('is-closed') + console.log('toggleSidebar', @el.parent() ) + @el.parent().find('.tabsSidebarSpace').toggleClass('is-closed') + @el.parent().find('.tabsSidebar').toggleClass('is-closed') showSidebar: -> - $('.content.active .tabsSidebarSpace').removeClass('is-closed') - $('.content.active .tabsSidebar').removeClass('is-closed') + @el.parent().find('.tabsSidebarSpace').removeClass('is-closed') + @el.parent().find('.tabsSidebar').removeClass('is-closed') toggleTab: (e) -> diff --git a/app/assets/javascripts/app/controllers/layout_ref.js.coffee b/app/assets/javascripts/app/controllers/layout_ref.js.coffee index a614574f5..4d8478d55 100644 --- a/app/assets/javascripts/app/controllers/layout_ref.js.coffee +++ b/app/assets/javascripts/app/controllers/layout_ref.js.coffee @@ -43,7 +43,7 @@ App.Config.set( 'layout_ref/content_sidebar_right_sidebar_optional', ContentSide class ContentSidebarTabsRight extends App.ControllerContent - elements: + elements: '.tabsSidebar' : 'sidebar' constructor: -> @@ -51,22 +51,22 @@ class ContentSidebarTabsRight extends App.ControllerContent @render() items = [ - head: 'Ticket Settings' - name: 'ticket' - icon: 'message' + head: 'Ticket Settings' + name: 'ticket' + icon: 'message' , - head: 'Customer' - name: 'customer' - icon: 'person' + head: 'Customer' + name: 'customer' + icon: 'person' , - head: 'Organization' - name: 'organization' - icon: 'group' + head: 'Organization' + name: 'organization' + icon: 'group' ] new App.Sidebar( - el: sidebar - items: items + el: @sidebar + items: items ) render: ->