提交 5926847d 编写于 作者: R rudolfwalter 提交者: Oleg Nenashev

[JENKINS-58240] - Plugins should be able to provide onBlur for codemirror textarea. (#4046)

上级 3424232a
......@@ -11,8 +11,13 @@ Behaviour.specify("TEXTAREA.codemirror", 'textarea', 0, function(e) {
var h = e.clientHeight || getTextareaHeight();
var config = e.getAttribute("codemirror-config");
config += (config ? ", " : " ") + "onBlur: function(editor){editor.save()}";
if (!config) {
config = '';
}
config = eval('({'+config+'})');
if (!config.onBlur) {
config.onBlur = function(editor) { editor.save(); };
}
var codemirror = CodeMirror.fromTextArea(e,config);
e.codemirrorObject = codemirror;
if(typeof(codemirror.getScrollerElement) !== "function") {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册