Преглед на файлове

HUE-7198 [editor] Remove unused onBlur code to improve IE 11 debug performance

For some reason the exception handling make the IE 11 dev tools sluggish. The event handler always hits the catch block as there's no global viewModel, the lastWrittenSnippet cache is not used anymore so removing it.
Johan Ahlen преди 8 години
родител
ревизия
dab80b1805
променени са 2 файла, в които са добавени 0 реда и са изтрити 25 реда
  1. 0 12
      desktop/libs/notebook/src/notebook/templates/editor_components.mako
  2. 0 13
      desktop/libs/notebook/src/notebook/templates/editor_m.mako

+ 0 - 12
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -1124,7 +1124,6 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
         snippet: $data,
         contextTooltip: '${ _ko("Right-click for details") }',
         expandStar: '${ _ko("Right-click to expand with columns") }',
-        onBlur: saveTemporarySnippet,
         highlightedRange: result.statement_range,
         useNewAutocompleter: $root.useNewAutocompleter,
         readOnly: $root.isPresentationMode(),
@@ -2664,17 +2663,6 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
     return _datum;
   }
 
-  function saveTemporarySnippet($element, value) {
-    if ($element.data('last-active-editor')) {
-      try {
-        if (viewModel.editorType() != 'notebook') {
-          $.totalStorage('hue.notebook.lastWrittenSnippet.${user}.' + viewModel.editorType(), value);
-        }
-      }
-      catch (e){} // storage quota exceeded with enormous editor content
-    }
-  }
-
   (function () {
     ko.options.deferUpdates = true;
 

+ 0 - 13
desktop/libs/notebook/src/notebook/templates/editor_m.mako

@@ -77,7 +77,6 @@ ${ commonheader_m(editor_type, editor_type, user, request, "68px") | n,unicode }
         snippet: $data,
         contextTooltip: '${ _ko("Right-click for details") }',
         expandStar: '${ _ko("Shift + Click to replace with all columns") }',
-        onBlur: saveTemporarySnippet,
         highlightedRange: result.statement_range,
         useNewAutocompleter: $root.useNewAutocompleter,
         aceOptions: {
@@ -298,18 +297,6 @@ ${ assist.assistJSModels() }
     }
   });
 
-  function saveTemporarySnippet($element, value) {
-    if ($element.data('last-active-editor')) {
-      try {
-        if (viewModel.editorType() != 'notebook') {
-          $.totalStorage('hue.notebook.lastWrittenSnippet.${user}.' + viewModel.editorType(), value);
-        }
-      }
-      catch (e) {
-      } // storage quota exceeded with enormous editor content
-    }
-  }
-
   var viewModel;
 
   $(document).ready(function () {