From 4fab8007e403fa5e32186efdf62497d7c38bbe2b Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Wed, 6 Sep 2017 13:48:57 +0200 Subject: [PATCH] Fixed issue #777 - Wrong behaviour in tagging functionality. --- app/assets/javascripts/app/controllers/ticket_zoom.coffee | 2 +- .../app/controllers/ticket_zoom/sidebar_ticket.coffee | 2 +- app/assets/javascripts/app/controllers/widget/tag.coffee | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.coffee index a08b201be..094a15f30 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.coffee @@ -693,7 +693,7 @@ class App.TicketZoom extends App.Controller tagAdd: (tag) => return if !@sidebar return if !@sidebar.reload - @sidebar.reload(tagAdd: tag) + @sidebar.reload(tagAdd: tag, source: 'macro') tagRemove: (tag) => return if !@sidebar return if !@sidebar.reload diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_ticket.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_ticket.coffee index 52ea11299..cb656f976 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_ticket.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/sidebar_ticket.coffee @@ -69,7 +69,7 @@ class SidebarTicket extends App.Controller if args.tags @tagWidget.reload(args.tags) if args.tagAdd - @tagWidget.add(args.tagAdd) + @tagWidget.add(args.tagAdd, args.source) if args.tagRemove @tagWidget.remove(args.tagRemove) diff --git a/app/assets/javascripts/app/controllers/widget/tag.coffee b/app/assets/javascripts/app/controllers/widget/tag.coffee index f148746fa..ee0f4b455 100644 --- a/app/assets/javascripts/app/controllers/widget/tag.coffee +++ b/app/assets/javascripts/app/controllers/widget/tag.coffee @@ -86,16 +86,16 @@ class App.WidgetTag extends App.Controller return @add(item) - add: (items) => + add: (items, source = '') => for item in items.split(',') item = item.trim() - @addItem(item) + @addItem(item, source) - addItem: (item) => + addItem: (item, source = '') => if _.contains(@localTags, item) @render() return - return if App.Config.get('tag_new') is false && !@possibleTags[item] + return if source != 'macro' && App.Config.get('tag_new') is false && !@possibleTags[item] @localTags.push item @render() App[@object_type].tagAdd(@object.id, item)