From c1ae526ac0fd69ba56af1beac91121f80f33e220 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Fri, 25 Feb 2022 10:48:37 +0100 Subject: [PATCH] Follow up 92b7c398797deec96a3828e4613c1ed2448c0889 - Fixes #3930 - Make sidebar attachments unique. --- .../ticket_zoom/sidebar_article_attachments.coffee | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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()