aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-04-10 11:37:57 +0200
committerMario Vavti <mario@mariovavti.com>2018-04-10 11:37:57 +0200
commita2cb7b9ca4e4dabb59f43c9dd0d610792fbd0e63 (patch)
treec684c2167147bc1b953a40ea6037949dc14f4bf6 /view
parent91aeb2552308d782970ccff2eaa2ac814bc4a223 (diff)
downloadvolse-hubzilla-a2cb7b9ca4e4dabb59f43c9dd0d610792fbd0e63.tar.gz
volse-hubzilla-a2cb7b9ca4e4dabb59f43c9dd0d610792fbd0e63.tar.bz2
volse-hubzilla-a2cb7b9ca4e4dabb59f43c9dd0d610792fbd0e63.zip
do not get or set post category if the field is not available. remove logging.
Diffstat (limited to 'view')
-rwxr-xr-xview/tpl/jot-header.tpl8
1 files changed, 5 insertions, 3 deletions
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index 68f7e7a41..d6d93a863 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -567,11 +567,12 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del
function postSaveChanges(action, type) {
if({{$auto_save_draft}}) {
- console.log(action);
+
if(action != 'clean') {
localStorage.setItem("post_title", $("#jot-title").val());
localStorage.setItem("post_body", $("#profile-jot-text").val());
- localStorage.setItem("post_category", $("#jot-category").val());
+ if($("#jot-category").length)
+ localStorage.setItem("post_category", $("#jot-category").val());
}
if(action == 'start') {
@@ -603,8 +604,9 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del
if({{$auto_save_draft}}) {
var postTitle = localStorage.getItem("post_title");
var postBody = localStorage.getItem("post_body");
- var postCategory = localStorage.getItem("post_category");
+ var postCategory = (($("#jot-category").length) ? localStorage.getItem("post_category") : '');
var openEditor = false;
+
if(postTitle) {
$('#jot-title').val(postTitle);
openEditor = true;