浏览代码

HUE-7911 [hbase] HBase browser create table js error

Enrico Berti 7 年之前
父节点
当前提交
c597cd7
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      apps/hbase/src/hbase/templates/app.mako

+ 3 - 3
apps/hbase/src/hbase/templates/app.mako

@@ -169,7 +169,7 @@ ${ commonheader(None, "hbase", user, request) | n,unicode }
         % endif
         % endif
         % if can_write:
         % if can_write:
         <span class="pull-right">
         <span class="pull-right">
-          <a href="#new_table_modal" role="button" data-bind="click: function(){prepareNewTableForm(); hbaseApp.focusModel(hbaseApp.views.tables);}" class="btn" data-toggle="modal"><i class='fa fa-plus-circle'></i> ${_('New Table')}</a>
+          <a href="#new_table_modal" role="button" data-bind="click: function(){ huePubSub.publish('hbase.prepare.new.form'); hbaseApp.focusModel(hbaseApp.views.tables);}" class="btn" data-toggle="modal"><i class='fa fa-plus-circle'></i> ${_('New Table')}</a>
         </span>
         </span>
         % endif
         % endif
       </div>
       </div>
@@ -2515,10 +2515,10 @@ ${ commonheader(None, "hbase", user, request) | n,unicode }
       $(this).trigger('reset');
       $(this).trigger('reset');
     });
     });
 
 
-    var prepareNewTableForm = function () {
+    huePubSub.subscribe('hbase.prepare.new.form', function () {
       $("#new_table_modal .modal-body ul").empty();
       $("#new_table_modal .modal-body ul").empty();
       addColumnToNewTableForm();
       addColumnToNewTableForm();
-    }
+    }, 'hbase');
 
 
     var addColumnToNewTableForm = function () {
     var addColumnToNewTableForm = function () {
       var $li = $("<li>").addClass("column").css("marginBottom", "10px").html($("#columnTemplate").html());
       var $li = $("<li>").addClass("column").css("marginBottom", "10px").html($("#columnTemplate").html());