Переглянути джерело

[editor] Limited editor expansion to 2000 lines

Enrico Berti 9 роки тому
батько
коміт
3a2cfe6912

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

@@ -1359,11 +1359,14 @@
       var autoExpandTimeout = window.setInterval(function () {
         var chunks = Math.floor((Math.max(ace().session.getLength(), 4) - lastEditorHeight) / 4);
         if (chunks !== 0) {
-          if ($target.height() + 64 * chunks < $(window).height() - $target.position().top - 90) {
+          if (ace().session.getLength() < 2000) {
             $target.height($target.height() + 64 * chunks);
-            ace().resize();
-            lastEditorHeight += 4 * chunks;
           }
+          else {
+            $target.height(2000 * 16); // height of 2000 lines
+          }
+          ace().resize();
+          lastEditorHeight += 4 * chunks;
         }
       }, 300);