From 8d26961639eedf76fce06e81c81ebc8fa9b29ae2 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 8 Mar 2021 19:25:01 +0000 Subject: fix summary not saved in browser autosave draft --- view/tpl/jot-header.tpl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'view') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index dde623783..2ec581e05 100644 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -570,6 +570,7 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del if(action != 'clean') { localStorage.setItem("post_title" + postid, $("#jot-title").val()); + localStorage.setItem("post_summary" + postid, $("#jot-summary").val()); localStorage.setItem("post_body" + postid, $("#profile-jot-text").val()); if($("#jot-category").length) localStorage.setItem("post_category" + postid, $("#jot-category").val()); @@ -590,6 +591,7 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del clearTimeout(postSaveTimer); postSaveTimer = null; localStorage.removeItem("post_title" + postid); + localStorage.removeItem("post_summary" + postid); localStorage.removeItem("post_body" + postid); localStorage.removeItem("post_category" + postid); } @@ -605,6 +607,7 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del var doctype = $('#jot-webpage').val(); var postid = '-' + doctype + '-' + $('#jot-postid').val(); var postTitle = localStorage.getItem("post_title" + postid); + var postSummary = localStorage.getItem("post_summary" + postid); var postBody = localStorage.getItem("post_body" + postid); var postCategory = (($("#jot-category").length) ? localStorage.getItem("post_category" + postid) : ''); var openEditor = false; @@ -613,6 +616,10 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del $('#jot-title').val(postTitle); openEditor = true; } + if(postSummary) { + $('#jot-summary').val(postSummary); + openEditor = true; + } if(postBody) { $('#profile-jot-text').val(postBody); openEditor = true; -- cgit v1.2.3