Browse Source

HUE-7212 [editor] Properly scroll to the executing query when selected queries are executed

Johan Ahlen 8 years ago
parent
commit
21690326c9
1 changed files with 3 additions and 3 deletions
  1. 3 3
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

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

@@ -3992,8 +3992,7 @@
             if (item.line !== null) {
             if (item.line !== null) {
               if (type === 'error') {
               if (type === 'error') {
                 editor.addError(item.message, item.line + offset);
                 editor.addError(item.message, item.line + offset);
-              }
-              else {
+              } else {
                 editor.addWarning(item.message, item.line + offset);
                 editor.addWarning(item.message, item.line + offset);
               }
               }
               if (cnt == 0) {
               if (cnt == 0) {
@@ -4881,7 +4880,8 @@
                 background-color: #E3F7FF;\
                 background-color: #E3F7FF;\
                 position: absolute;\
                 position: absolute;\
             }');
             }');
-            editor.scrollToLine(range.start.row, true, true, function () {});
+            var selectionRange = editor.getSelectionRange();
+            editor.scrollToLine(Math.min(selectionRange.start.row, selectionRange.end.row) + range.start.row, true, true, function () {});
           }
           }
         }
         }
         try {
         try {