Эх сурвалжийг харах

[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 жил өмнө
parent
commit
2af89cbe63

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

@@ -845,11 +845,11 @@
       var lastEditorHeight = 7;
       var lastEditorHeight = 7;
 
 
       var autoExpandTimeout = window.setInterval(function () {
       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) {
         if (chunks !== 0) {
-          $target.height($target.height() + 128 * chunks);
+          $target.height($target.height() + 64 * chunks);
           ace().resize();
           ace().resize();
-          lastEditorHeight += 8 * chunks;
+          lastEditorHeight += 4 * chunks;
         }
         }
       }, 300);
       }, 300);