1. 文章编辑加入未保存浏览器缓存

2. 文章编辑标题加入长度检查
This commit is contained in:
2018-05-13 00:38:49 +08:00
parent 976c62197a
commit 9011563784
7 changed files with 38 additions and 12 deletions

View File

@@ -254,7 +254,17 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'face'], f
var E = window.wangEditor;
var editor = new E('#editor');
editor.customConfig.uploadImgServer = '/upload/img';
editor.create()
var cache_key = "content_" + $("input[name='contentId']").val();
var html = localStorage.getItem(cache_key);
editor.customConfig.onblur = function (html) {
localStorage.setItem(cache_key, html);
};
editor.create();
if (html) editor.txt.html(html);//缓存的内容
return editor;
}
@@ -319,11 +329,11 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'face'], f
return arguments.callee;
}
,userstat: function () {
/*,userstat: function () {
$.getJSON("/os/user/stat",{},function (data) {
$("#user_count").html(data.count);
});
}
}*/
};