From 91aeb2552308d782970ccff2eaa2ac814bc4a223 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 10 Apr 2018 11:17:20 +0200 Subject: fix autosave content not cleaned after post submission --- view/tpl/jot-header.tpl | 71 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 24 deletions(-) (limited to 'view/tpl/jot-header.tpl') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 7af344681..68f7e7a41 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -563,35 +563,43 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del \ No newline at end of file + $(document).on('submit', '#profile-jot-form', function() { + postSaveChanges('clean'); + cleaned = true; + }); + + $(document).on('focusout',"#profile-jot-wrapper",function(e){ + if(! cleaned) + postSaveChanges('stop'); + }); + + $(document).on('focusin',"#profile-jot-wrapper",function(e){ + postSaveTimer = setTimeout(function () { + postSaveChanges('start'); + },10000); + }); + + + }); + -- cgit v1.2.3