瀏覽代碼

[editor] Change auto-resize of editor to add 4 new lines instead of 8

It will also skip expanding for the first 3 as the editor has a min-height of 8 lines.
Johan Ahlen 10 年之前
父節點
當前提交
2af89cbe63
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

+ 3 - 3
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -845,11 +845,11 @@
       var lastEditorHeight = 7;
 
       var autoExpandTimeout = window.setInterval(function () {
-        var chunks = Math.floor((ace().session.getLength() - lastEditorHeight) / 8) + 1;
+        var chunks = Math.floor((Math.max(ace().session.getLength(), 4) - lastEditorHeight) / 4);
         if (chunks !== 0) {
-          $target.height($target.height() + 128 * chunks);
+          $target.height($target.height() + 64 * chunks);
           ace().resize();
-          lastEditorHeight += 8 * chunks;
+          lastEditorHeight += 4 * chunks;
         }
       }, 300);