From adc8edb7916041ab4fdd74d7b16856cc3f0da9f1 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 12 Sep 2014 12:10:48 +0000 Subject: [PATCH] Implement draft autosaving for mail compose. - Auto saving interval is every 2 minutes. --- mail/js/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mail/js/app.js b/mail/js/app.js index 876a5dcd1b..47e96fa31b 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -191,7 +191,12 @@ app.classes.mail = AppJS.extend( var that = this; this.mail_isMainWindow = false; this.compose_fieldExpander_hide(); - + + // Set autosaving interval to 2 minutes for compose message + window.setInterval(function (){ + that.saveAsDraft(null,that.et2.getWidgetById('button[saveAsDraft]'),'autosaving'); + }, 120000); + /* Control focus actions on subject to handle expanders properly.*/ jQuery("#mail-compose_subject").on({ focus:function(){