瀏覽代碼

Codemirror textarea support rows argument

wangweimin 5 年之前
父節點
當前提交
e2a5b9a6e2
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      pywebio/html/js/form.js

+ 2 - 1
pywebio/html/js/form.js

@@ -618,8 +618,9 @@
                 };
                 for (var k in that.spec.codemirror) config[k] = that.spec.codemirror[k];
                 that.code_mirror = CodeMirror.fromTextArea(that.element.find('textarea')[0], config);
+                that.code_mirror.setSize(null, 20 * that.spec.rows);
                 CodeMirror.autoLoadMode(that.code_mirror, config.mode);
-                if(config.theme)
+                if (config.theme)
                     load_codemirror_theme(config.theme);
             }, ShowDuration + 100);
         }