浏览代码

HUE-5619 [editor] Fix browser search override dark pattern

Enrico Berti 9 年之前
父节点
当前提交
ed0da1e
共有 1 个文件被更改,包括 10 次插入10 次删除
  1. 10 10
      desktop/libs/notebook/src/notebook/templates/editor_components.mako

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

@@ -3749,9 +3749,18 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
       huePubSub.subscribe('editor.save', saveKeyHandler);
 
       $(document).bind('keyup', function (e) {
-        if (e.keyCode == 191 && !$(e.target).is('input') && !$(e.target).is('textarea')) {
+        if (e.keyCode == 191 && e.shiftKey && !$(e.target).is('input') && !$(e.target).is('textarea')) {
           $('#helpModal').modal('show');
         }
+
+        if (e.keyCode == 191 && !e.shiftKey && !$(e.target).is('input') && !$(e.target).is('textarea')) {
+          if (viewModel.editorMode() && viewModel.selectedNotebook().snippets()[0].currentQueryTab() == 'queryResults') {
+            e.preventDefault();
+            var $t = $("#snippet_" + viewModel.selectedNotebook().snippets()[0].id()).find(".resultTable");
+            $t.hueDataTable().fnShowSearch();
+            return false;
+          }
+        }
       });
 
       function newKeyHandler() {
@@ -3769,15 +3778,6 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
         return false;
       });
 
-      $(window).bind("keydown", "ctrl+f alt+f meta+f", function (e) {
-        if (viewModel.editorMode() && viewModel.selectedNotebook().snippets()[0].currentQueryTab() == 'queryResults') {
-          e.preventDefault();
-          var $t = $("#snippet_" + viewModel.selectedNotebook().snippets()[0].id()).find(".resultTable");
-          $t.hueDataTable().fnShowSearch();
-          return false;
-        }
-      });
-
       huePubSub.subscribe('editor.create.new', newKeyHandler);
 
       var initialResizePosition = 100;