diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_article_attachments.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_article_attachments.coffee index 743cb38ac..ec4a20933 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_article_attachments.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_article_attachments.coffee @@ -1,4 +1,12 @@ class SidebarArticleAttachments extends App.Controller + constructor: -> + super + @controllerBind('ui::ticket::load', (data) => + return if data.ticket_id.toString() isnt @ticket.id.toString() + return if !@el + @showObjects(@el) + ) + sidebarItem: => return if !@Config.get('ui_ticket_zoom_sidebar_article_attachments') @item = { @@ -43,9 +51,6 @@ class SidebarArticleAttachments extends App.Controller @el.on('click', '.js-attachments img', (e) => @imageView(e) ) - @controllerBind('ui::ticket::load', => - @showObjects(el) - ) imageView: (e) -> e.preventDefault()