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

HUE-8360 [editor] The row detail modal shouldn't be triggered by a double click on the cells

Enrico Berti 7 жил өмнө
parent
commit
9d0ef5d6ae

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/jquery.tableextender.js

@@ -195,7 +195,7 @@
     });
     $(document).on('dblclick', '.dataTables_wrapper > table tbody tr', function () {
       if (huePubSub){
-        huePubSub.publish('table.row.dblclick', {idx: $(this).index(), table: $(this).parents('table')});
+        huePubSub.publish('table.row.show.details', {idx: $(this).index(), table: $(this).parents('table')});
       }
     });
   };

+ 1 - 10
desktop/core/src/desktop/static/desktop/js/jquery.tableextender2.js

@@ -179,15 +179,6 @@
       self.$parent.children('table').on('mouseout', 'tbody tr', outHandler);
     });
 
-    var dblClickHandler = function () {
-      huePubSub.publish('table.row.dblclick', {idx: $(this).index(), table: $(this).parents('table')});
-    };
-    self.$parent.children('table').on('dblclick', 'tbody tr', dblClickHandler);
-    self.disposeFunctions.push(function () {
-      self.$parent.children('table').off('dblclick', 'tbody tr', dblClickHandler);
-    });
-
-
     if (!self.options.disableTopPosition) {
       self.repositionHeader();
       var scrollFunction = self.repositionHeader.bind(self);
@@ -427,7 +418,7 @@
           self.drawLockedRow($(this).parent().text()*1);
         }).attr('title', self.options.labels.LOCK);
         $('<i>').addClass('fa fa-expand pointer muted').prependTo(cell).on('click', function(){
-          huePubSub.publish('table.row.dblclick', {idx: idx, table: self.$element});
+          huePubSub.publish('table.row.show.details', {idx: idx, table: self.$element});
         }).attr('title', self.options.labels.ROW_DETAILS);
       });
     }

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/jquery.tableextender3.js

@@ -207,7 +207,7 @@
       }
       $cell.addClass('lockable');
       $('<i>').addClass('fa fa-expand pointer muted').attr('title', self.options.labels.ROW_DETAILS).on('click', function(){
-        huePubSub.publish('table.row.dblclick', { idx: index, table: self.$sourceTable });
+        huePubSub.publish('table.row.show.details', { idx: index, table: self.$sourceTable });
       }).prependTo($cell);
     });
 

+ 1 - 1
desktop/core/src/desktop/templates/common_header_footer_components.mako

@@ -329,7 +329,7 @@ from metadata.conf import has_optimizer, OPTIMIZER
 
     var multiLineHandlers = [];
 
-    huePubSub.subscribe('table.row.dblclick', function (data) {
+    huePubSub.subscribe('table.row.show.details', function (data) {
       var $el = $(data.table);
       var $t = $('#rowDetailsModal').find('table');
       $t.html('');