👽 修改编辑文章时自动填充固定路径的逻辑

仅当第一次输入标题且当路径为空的时候自动填充
pull/18/head
ruibaby 2018-05-29 17:08:00 +08:00
parent e059dd05e3
commit f98ee92693
1 changed files with 1 additions and 1 deletions

View File

@ -246,7 +246,7 @@
*/ */
function autoComplateUrl() { function autoComplateUrl() {
var titleVal = $("#post_title").val(); var titleVal = $("#post_title").val();
if(titleVal!="" && titleVal!=null){ if(titleVal!="" && titleVal!=null && $("#postUrl").html()==''){
var result = $("#post_title").toPinyin().toLowerCase(); var result = $("#post_title").toPinyin().toLowerCase();
$("#postUrl").html(result.substring(0,result.length-1)); $("#postUrl").html(result.substring(0,result.length-1));
} }