From a7cf3da7da262d9df4933eb1c3548a7401361f53 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 15 Oct 2017 20:36:01 +0200 Subject: [PATCH] Improved d&d batches (sometimes mouseleave is fired if seleced batch is fade out - so no ticket is processed). --- .../javascripts/app/controllers/ticket_overview.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_overview.coffee b/app/assets/javascripts/app/controllers/ticket_overview.coffee index da11a230f..de9d4df17 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.coffee @@ -108,6 +108,8 @@ class App.TicketOverview extends App.Controller $(document).off 'mouseup.item' pos = @batchDragger.data() + @clearDelay('clear-hovered-batch-entry') + if !@hoveredBatchEntry @cleanUpDrag() return @@ -513,6 +515,7 @@ class App.TicketOverview extends App.Controller @hoveredBatchEntry = entryAtPoint.closest('.js-batch-overlay-entry').addClass('is-hovered') highlightBatchEntry: (event) -> + @clearDelay('clear-hovered-batch-entry') @hoveredBatchEntry = $(event.currentTarget).closest('.js-batch-overlay-entry').addClass('is-hovered') if @hoveredBatchEntry.attr('data-action') is 'group_assign' @@ -528,7 +531,9 @@ class App.TicketOverview extends App.Controller clearTimeout @batchAssignGroupHintTimeout @hoveredBatchEntry.removeClass('is-hovered') - @hoveredBatchEntry = null + delay = => + @hoveredBatchEntry = null + @delay(delay, 800, 'clear-hovered-batch-entry') blinkBatchEntry: => @hoveredBatchEntry @@ -953,7 +958,6 @@ class Table extends App.Controller ticketListShow.push App.Ticket.find(ticket.id) console.log('overview', overview) @overview = App.Overview.find(overview.id) - console.log('TTT', @overview.view.s) @table.update( overviewAttributes: @overview.view.s objects: ticketListShow @@ -1508,7 +1512,6 @@ class App.OverviewSettings extends App.ControllerModal App.OverviewListCollection.fetch(@overview.link) else App.OverviewIndexCollection.trigger() - console.log('TRIGGER', @overview.link) App.OverviewListCollection.trigger(@overview.link) # close modal