Эх сурвалжийг харах

[core] Add support for hidden overflow to the Ace editor

This also adds hue-ace-dev.sh which will generate non-minified code, handy for debugging.
Johan Ahlen 10 жил өмнө
parent
commit
45272c3

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
desktop/core/src/desktop/static/desktop/js/ace/ace.js


+ 23 - 0
tools/ace-editor/hue-ace-dev.sh

@@ -0,0 +1,23 @@
+#!/bin/bash
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+echo "Compiling and copying Ace Editor for Hue"
+rm -rf ../../desktop/core/src/desktop/static/desktop/js/ace/* || echo "Skipping removal of folder"
+node ./Makefile.dryice.js minimal --nc --s --target ../../desktop/core/src/desktop/static/desktop/js/ace/
+mv ../../desktop/core/src/desktop/static/desktop/js/ace/src-noconflict/* ../../desktop/core/src/desktop/static/desktop/js/ace/
+rmdir ../../desktop/core/src/desktop/static/desktop/js/ace/src-noconflict
+echo "Done!"

+ 17 - 0
tools/ace-editor/hue-ace.sh

@@ -1,3 +1,20 @@
+#!/bin/bash
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 echo "Compiling and copying Ace Editor for Hue"
 rm -rf ../../desktop/core/src/desktop/static/desktop/js/ace/* || echo "Skipping removal of folder"
 node ./Makefile.dryice.js minimal --m --nc --s --target ../../desktop/core/src/desktop/static/desktop/js/ace/

+ 6 - 2
tools/ace-editor/lib/ace/mouse/default_handlers.js

@@ -247,8 +247,12 @@ function DefaultHandlers(mouseHandler) {
         var dt = t - (this.$lastScrollTime||0);
         
         var editor = this.editor;
-        var isScrolable = editor.renderer.isScrollableBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed);
-        if (isScrolable || dt < 200) {
+
+        // Check if overflow is hidden on the container
+        var hiddenOverflow = editor.container.style.overflow == "hidden";
+
+        var isScrollable = !hiddenOverflow && editor.renderer.isScrollableBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed);
+        if (isScrollable || dt < 200) {
             this.$lastScrollTime = t;
             editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed);
             return ev.stop();

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно