From 5472a6b648cf3ba5643bfad9b49acc1b53ee84aa Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 24 Jul 2013 12:01:16 +0200 Subject: [PATCH] Improved autosave. --- .../app/controllers/agent_ticket_create.js.coffee | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index 349678c02..c9c399e7b 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -49,12 +49,6 @@ class App.TicketCreate extends App.Controller @log 'notice', 'error', defaults @render(defaults) - # start auto save - @delay( - => @autosave(), - 5000 - ) - meta: => text = App.i18n.translateInline( @article_attributes['title'] ) subject = @el.find('[name=subject]').val() @@ -91,7 +85,7 @@ class App.TicketCreate extends App.Controller @autosaveLast = data @log 'notice', 'form hash changed', diff, data App.TaskManager.update( @task_key, { 'state': data }) - @interval( update, 10000, @id, @auto_save_key ) + @interval( update, 3000, @id, @auto_save_key ) # get data / in case also ticket data for split fetch: (params) -> @@ -211,6 +205,9 @@ class App.TicketCreate extends App.Controller el: @el.find('.ticket-create').find('textarea') ) + # start auto save + @autosave() + localUserInfo: (params) => # update text module UI