Ver código fonte

HUE-4475 [editor] Lines are not expanded when loading a long query from the cookie

Enrico Berti 9 anos atrás
pai
commit
9dde45ea39

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

@@ -1452,7 +1452,7 @@
           var resized = false;
           if (ace().session.getLength() > editorHeight) {
             if (ace().session.getLength() < maxAutoLines) {
-              $target.height((ace().session.getLength() + 1) * 16);
+              $target.height(ace().session.getLength() * 16);
             }
             else {
               $target.height(maxAutoLines * 16); // height of maxAutoLines
@@ -1463,6 +1463,10 @@
             $target.height((ace().session.getLength()) * 16);
             resized = true;
           }
+          else {
+            $target.height(8 * 16);
+            resized = true;
+          }
           if (resized) {
             ace().resize();
             editorHeight = Math.min(maxAutoLines, ace().session.getLength());
@@ -3225,6 +3229,7 @@
             editor.scrollToLine(range.start.row, true, true, function () {});
           }
         }
+        editor._emit('change')
       }
     }
   };

+ 4 - 4
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -1502,10 +1502,10 @@ ${ hueIcons.symbols() }
       <ul class="table-drop-menu hue-context-menu">
         <li class="editor-drop-value"><a href="javascript:void(0);">"<span class="editor-drop-identifier"></span>"</a></li>
         <li class="divider"></li>
-        <li class="editor-drop-select"><a href="javascript:void(0);">${ _('SELECT FROM ') } <span class="editor-drop-identifier"></span>...</a></li>
-        <li class="editor-drop-insert"><a href="javascript:void(0);">${ _('INSERT INTO') } <span class="editor-drop-identifier"></span>...</a></li>
-        <li class="editor-drop-update"><a href="javascript:void(0);">${ _('UPDATE') } <span class="editor-drop-identifier"></span>...</a></li>
-        <li class="editor-drop-delete"><a href="javascript:void(0);">${ _('DELETE FROM') } <span class="editor-drop-identifier"></span>...</a></li>
+        <li class="editor-drop-select"><a href="javascript:void(0);">SELECT FROM <span class="editor-drop-identifier"></span>...</a></li>
+        <li class="editor-drop-insert"><a href="javascript:void(0);">INSERT INTO <span class="editor-drop-identifier"></span>...</a></li>
+        <li class="editor-drop-update"><a href="javascript:void(0);">UPDATE <span class="editor-drop-identifier"></span>...</a></li>
+        <li class="editor-drop-delete"><a href="javascript:void(0);">DELETE FROM <span class="editor-drop-identifier"></span>...</a></li>
       </ul>
     </div>
     <div class="clearfix"></div>