Forráskód Böngészése

HUE-9187 [editor] Fix garbled editor after clicking "new" in editor v2

Johan Ahlen 5 éve
szülő
commit
fa659d978c

+ 1 - 1
desktop/core/src/desktop/js/ko/bindings/ace/ko.aceEditor.js

@@ -44,7 +44,7 @@ ko.bindingHandlers.aceEditor = {
 
     $el.text(snippet.statement_raw());
 
-    const editor = ace.edit($el.attr('id'));
+    const editor = ace.edit(snippet.id());
     const AceRange = ace.require('ace/range').Range;
 
     const resizeAce = function() {

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

@@ -1541,7 +1541,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
   <!-- ko ifnot: $root.isPresentationMode() -->
   <div class="row-fluid">
     <div class="span6" data-bind="clickForAceFocus: ace">
-      <div class="ace-editor" data-bind="attr: { id: id() }, aceEditor: {
+      <div class="ace-editor" data-bind="attr: { id: id }, aceEditor: {
         snippet: $data,
         updateOnInput: true
       }"></div>

+ 2 - 2
desktop/libs/notebook/src/notebook/templates/editor_components2.mako

@@ -905,7 +905,7 @@
               'active-editor': inFocus
             },
             attr: {
-              id: id()
+              id: id
             },
             delayedOverflow: 'slow',
             aceEditor: {
@@ -1040,7 +1040,7 @@
     <!-- ko ifnot: $root.isPresentationMode() -->
     <div class="row-fluid">
       <div class="span6" data-bind="clickForAceFocus: ace.bind($data)">
-        <div class="ace-editor" data-bind="attr: { id: id() }, aceEditor: {
+        <div class="ace-editor" data-bind="attr: { id: id }, aceEditor: {
         snippet: $data,
         updateOnInput: true
       }"></div>

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/editor_m.mako

@@ -72,7 +72,7 @@ ${ commonheader_m(editor_type, editor_type, user, request, "68px") | n,unicode }
 <!-- ko with: selectedNotebook -->
 
   <!-- ko foreach: snippets  -->
-  <div class="ace-editor" data-bind="attr: { id: id() }, aceEditor: {
+  <div class="ace-editor" data-bind="attr: { id: id }, aceEditor: {
         snippet: $data,
         contextTooltip: '${ _ko("Right-click for details") }',
         expandStar: '${ _ko("Shift + Click to replace with all columns") }',