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