From e9442937571038bd4a25eaf41ae05414748c1f70 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 31 Mar 2017 15:29:10 +0200 Subject: [PATCH] =?UTF-8?q?Fixed=20issue=20#907=20-=20=E2=80=9CAdd=20link?= =?UTF-8?q?=E2=80=9D-screen=20is=20not=20really=20useful.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/controllers/widget/link.coffee | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/app/assets/javascripts/app/controllers/widget/link.coffee b/app/assets/javascripts/app/controllers/widget/link.coffee index 98a45b1af..20dab6a91 100644 --- a/app/assets/javascripts/app/controllers/widget/link.coffee +++ b/app/assets/javascripts/app/controllers/widget/link.coffee @@ -110,8 +110,8 @@ class App.LinkAdd extends App.ControllerModal processData: true success: (data, status, xhr) => App.Collection.loadAssets(data.assets) - @ticket_ids_by_customer = data.ticket_ids_by_customer - @ticket_ids_recent_viewed = data.ticket_ids_recent_viewed + @ticketIdsByCustomer = data.ticket_ids_by_customer + @ticketIdsRecentViewed = data.ticket_ids_recent_viewed @render() ) @@ -122,30 +122,26 @@ class App.LinkAdd extends App.ControllerModal object: @object )) - list = [] - for ticket_id in @ticket_ids_by_customer + ticketIdsByCustomer = [] + for ticket_id in @ticketIdsByCustomer if ticket_id isnt @ticket.id - ticketItem = App.Ticket.fullLocal(ticket_id) - list.push ticketItem - new App.ControllerTable( - el: content.find('#ticket-merge-customer-tickets') - overview: ['number', 'title', 'state', 'group', 'created_at'] - model: App.Ticket - objects: list - radio: true + ticketIdsByCustomer.push ticket_id + new App.TicketList( + tableId: 'ticket-merge-customer-tickets' + el: content.find('#ticket-merge-customer-tickets') + ticket_ids: ticketIdsByCustomer + radio: true ) - list = [] - for ticket_id in @ticket_ids_recent_viewed + ticketIdsByRecentView = [] + for ticket_id in @ticketIdsRecentViewed if ticket_id isnt @ticket.id - ticketItem = App.Ticket.fullLocal( ticket_id ) - list.push ticketItem - new App.ControllerTable( - el: content.find('#ticket-merge-recent-tickets') - overview: ['number', 'title', 'state', 'group', 'created_at'] - model: App.Ticket - objects: list - radio: true + ticketIdsByRecentView.push ticket_id + new App.TicketList( + tableId: 'ticket-merge-recent-tickets' + el: content.find('#ticket-merge-recent-tickets') + ticket_ids: ticketIdsByRecentView + radio: true ) content.delegate('[name="ticket_number"]', 'focus', (e) ->