Переглянути джерело

HUE-1515 [hbase] Search Navbar no longer stickies in tableview

Added resetElements for table and query view
Fixed trackOnGA problem for disabled tracking
Enrico Berti 12 роки тому
батько
коміт
d123e0f545
2 змінених файлів з 6 додано та 7 видалено
  1. 2 0
      apps/hbase/static/js/app.js
  2. 4 7
      apps/hbase/static/js/utils.js

+ 2 - 0
apps/hbase/static/js/app.js

@@ -98,6 +98,7 @@ routie({
       logGA('query_table');
       app.station('table');
       Router.setTable(cluster, table);
+      resetElements();
       Views.render('dataview');
       app.views.tabledata._reloadcfs(function(){
         app.search.cur_input(query);
@@ -110,6 +111,7 @@ routie({
       logGA('view_table');
       Router.setTable(cluster, table);
       resetSearch();
+      resetElements();
       app.station('table');
       Views.render('dataview');
       routed = true;

+ 4 - 7
apps/hbase/static/js/utils.js

@@ -240,15 +240,12 @@ function prepForTransport(value) {
 };
 
 function logGA(postfix) {
-  function doLog() {
-    trackOnGA('hbase/' + postfix);
-  }
-  if(postfix == null)
+  if (postfix == null)
     postfix = "";
   if (typeof trackOnGA == 'function') {
-    doLog();
-  } else {
-    setTimeout(doLog, 10);
+    window.setTimeout(function () {
+      trackOnGA('hbase/' + postfix);
+    }, 10);
   }
 };