浏览代码

HUE-8659 [importer] Fix js exception with the field editor

Johan Ahlen 7 年之前
父节点
当前提交
7df4c16
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      desktop/core/src/desktop/templates/ko_components/ko_simple_ace_editor.mako

+ 5 - 0
desktop/core/src/desktop/templates/ko_components/ko_simple_ace_editor.mako

@@ -824,6 +824,11 @@ from desktop.views import _ko
             positionStatement: ko.observable({
               location: { first_line: 1, last_line: 1, first_column: 0, last_column: editor.getValue().length }
             }),
+            whenContextSet: function() {
+              var promise = $.Deferred().resolve().promise();
+              promise.dispose = function () {};
+              return promise;
+            },
             isSqlDialect: ko.observable(true),
             aceCursorPosition: ko.observable(),
             inFocus: ko.observable()