Browse Source

在已有textarea且其name属性值已设置的情况下,让name属性保持原样,否则设置为id+"-markdown-doc"

master
商讯在线 10 years ago
parent
commit
4b313c9651
  1. 6
      editormd.js
  2. 2
      editormd.min.js

6
editormd.js

@ -403,8 +403,10 @@
editor.append("<textarea></textarea>");
markdownTextarea = this.markdownTextarea = editor.children("textarea");
}
markdownTextarea.addClass(classNames.textarea.markdown).attr("name", id + "-markdown-doc").attr("placeholder", settings.placeholder);
if(markdownTextarea.attr("name")=="undefined"||markdownTextarea.attr("name")==""){
markdownTextarea.attr("name", id + "-markdown-doc");
}
markdownTextarea.addClass(classNames.textarea.markdown).attr("placeholder", settings.placeholder);
var appendElements = [
(!settings.readOnly) ? "<a href=\"javascript:;\" class=\"fa fa-close " + classPrefix + "preview-close-btn\"></a>" : "",

2
editormd.min.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save