Parcourir la source

HUE-8965 [frontend] Remove draggable functionality from the top search results

Johan Ahlen il y a 6 ans
Parent
commit
2990d2bc6c
1 fichiers modifiés avec 0 ajouts et 26 suppressions
  1. 0 26
      desktop/core/src/desktop/js/ko/components/ko.globalSearch.js

+ 0 - 26
desktop/core/src/desktop/js/ko/components/ko.globalSearch.js

@@ -59,19 +59,11 @@ const TEMPLATE = `
         <div class="global-search-category-header" data-bind="text: label"></div>
         <ul>
           <!-- ko foreach: expanded() ? result : topMatches -->
-          <!-- ko if: typeof draggable !== 'undefined' -->
-          <li class="result" data-bind="multiClick: {
-              click: function () { $parents[1].resultSelected($parentContext.$index(), $index()) },
-              dblClick: function () { $parents[1].resultSelected($parentContext.$index(), $index()); $parents[1].openResult(); }
-            }, html: label, css: { 'selected': $parents[1].selectedResult() === $data }, draggableText: { text: draggable, meta: draggableMeta }"></li>
-          <!-- /ko -->
-          <!-- ko if: typeof draggable === 'undefined' -->
           <li class="result" data-bind="multiClick: {
               click: function () { $parents[1].resultSelected($parentContext.$index(), $index()) },
               dblClick: function () { $parents[1].resultSelected($parentContext.$index(), $index()); $parents[1].openResult(); }
             }, html: label, css: { 'selected': $parents[1].selectedResult() === $data }"></li>
           <!-- /ko -->
-          <!-- /ko -->
           <!-- ko if: topMatches.length < result.length && !expanded() -->
           <li class="blue" data-bind="toggle: expanded">${I18n('Show more...')}</li>
           <!-- /ko -->
@@ -189,18 +181,6 @@ class GlobalSearch {
     huePubSub.subscribe('context.popover.show.in.assist', deferredCloseIfVisible);
     huePubSub.subscribe('sample.error.insert.click', deferredCloseIfVisible);
 
-    huePubSub.subscribe('draggable.text.started', meta => {
-      // We have to set the height to 0 when dragging a text, just closing the results will break the
-      // jQuery draggable plugin
-      if (meta.source === 'globalSearch') {
-        huePubSub.subscribeOnce('draggable.text.stopped', () => {
-          self.heightWhenDragging(null);
-          self.close();
-        });
-        self.heightWhenDragging(0);
-      }
-    });
-
     self.querySpec.subscribe(newValue => {
       window.clearTimeout(self.fetchThrottle);
       if (newValue && newValue.query !== '') {
@@ -511,10 +491,6 @@ class GlobalSearch {
             if (doc.hue_name.indexOf('.') !== 0) {
               docCategory.result.push({
                 label: doc.hue_name,
-                draggable: doc.originalName,
-                draggableMeta: {
-                  source: 'globalSearch'
-                },
                 type: 'document',
                 data: doc
               });
@@ -597,8 +573,6 @@ class GlobalSearch {
                 }
                 category.result.push({
                   label: result.hue_name || result.originalName,
-                  draggable: result.originalName,
-                  draggableMeta: meta,
                   type: typeLower,
                   data: result
                 });