Fixed issue #777 - Wrong behaviour in tagging functionality.

This commit is contained in:
Rolf Schmidt 2017-09-06 13:48:57 +02:00
parent e7eab89bce
commit 4fab8007e4
3 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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)

View file

@ -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)