浏览代码

HUE-3814 [editor] Disable history / saved query links if we are already on the same queries

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

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

@@ -1067,7 +1067,7 @@ ${ hueIcons.symbols() }
               <!-- /ko -->
             <table class="table table-condensed margin-top-10 history-table">
               <tbody data-bind="foreach: $parent.filteredHistory">
-                <tr class="pointer" data-bind="click: function() { if (getSelection().toString().length == 0) { $root.openNotebook(uuid()) } }">
+                <tr data-bind="click: function() { if (uuid() != $root.selectedNotebook().uuid()) { $root.openNotebook(uuid()); } }, css: { 'pointer': uuid() != $root.selectedNotebook().uuid() }">
                   <td style="width: 100px" class="muted" data-bind="style: {'border-top-width': $index() == 0 ? '0' : ''}">
                     <span data-bind="momentFromNow: {data: lastExecuted, interval: 10000, titleFormat: 'LLL'}"></span>
                   </td>
@@ -1119,7 +1119,7 @@ ${ hueIcons.symbols() }
               </tr>
             </thead>
             <tbody data-bind="foreach: queries">
-            <tr class="pointer" data-bind="click: function() { $root.openNotebook(uuid) }">
+            <tr data-bind="click: function() { if (uuid != $root.selectedNotebook().uuid()) { $root.openNotebook(uuid); } }, css: { 'pointer': uuid != $root.selectedNotebook().uuid() }">
               <td style="width: 16%"><span data-bind="ellipsis: {data: name, length: 30}"></span></td>
               <td style="width: 50%; white-space: normal"><span data-bind="text: description"></span></td>
               <td style="width: 18%"><span data-bind="text: owner"></span></td>