From 90068a6ba83ed1d9a43a21ea73c6a40af3bd9167 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 14 Sep 2015 19:12:40 +0200 Subject: [PATCH] Stop autosave if task is not active. --- .../javascripts/app/controllers/ticket_zoom.js.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 124d3c12a..cf8bd7ce2 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -101,6 +101,8 @@ class App.TicketZoom extends App.Controller @activeState = true + @autosaveStart() + App.Event.trigger('ui::ticket::shown', { ticket_id: @ticket_id } ) # inital load of highlights @@ -113,6 +115,7 @@ class App.TicketZoom extends App.Controller hide: => @activeState = false @positionPageHeaderStop() + @autosaveStop() changed: => return false if !@ticket @@ -349,8 +352,6 @@ class App.TicketZoom extends App.Controller @scrollTo( 0, offset ) @delay( scrollTo, 100, false ) - @autosaveStart() - @scrollToBottom() @positionPageHeaderStart() @@ -372,7 +373,8 @@ class App.TicketZoom extends App.Controller if !@autosaveLast @autosaveLast = @taskGet() update = => - #console.log('AR', @formParam( @el.find('.article-add') ) ) + #console.log('AR', @ticket_id, @ticket, @formParam( @el.find('.article-add') ) ) + return if !@ticket currentStoreTicket = @ticket.attributes() delete currentStoreTicket.article currentStore =