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

HUE-7207 [frontend] Fix fileChooser search for IE 11

This fixes both the search toggle and the actual search trigger for the fileChooser plugin
Johan Ahlen 8 жил өмнө
parent
commit
71e1588

+ 3 - 1
desktop/core/src/desktop/static/desktop/js/jquery.delayedinput.js

@@ -44,7 +44,9 @@
     var _this = this;
     var _timeout = -1;
     if (_this.options.fn != null) {
-      $(_this.element).on("keyup", function (e) {
+      var event = isIE11 ? 'input' : 'keyup';
+
+      $(_this.element).on(event, function (e) {
         if (!(_this.options.skipOnEnterAndKeys && [13, 37, 38, 39, 40].indexOf(e.keyCode) > -1)){
           window.clearTimeout(_timeout);
           _timeout = window.setTimeout(_this.options.fn, _this.options.timeout);

+ 8 - 7
desktop/core/src/desktop/static/desktop/js/jquery.filechooser.js

@@ -249,12 +249,14 @@
           if (this.offsetWidth - 18 < e.clientX - this.getBoundingClientRect().left) {
             $searchInput.removeClass("x onX").val("");
           }
-        })
-        .on("blur", function (e) {
-          if ($searchInput.val() === ''){
-            slideOutInput();
-          }
         });
+        if (!isIE11) {
+          $searchInput.on("blur", function (e) {
+            if ($searchInput.val() === ''){
+              slideOutInput();
+            }
+          });
+        }
 
         $search.find('.fa-search').on('click', function(){
           if ($searchInput.is(':visible')){
@@ -421,8 +423,7 @@
             if ($(this).text().toLowerCase().indexOf(filter) > -1) {
               $(this).show();
               results++;
-            }
-            else {
+            } else {
               $(this).hide();
             }
           });