ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject git commit: AMBARI-6353 Hosts page: filtering by hostname sometimes displays incorrect result after overlay goes away (but eventually catches up). (ababiichuk)
Date Wed, 02 Jul 2014 14:48:26 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c9fe537a2 -> e04dc67a6


AMBARI-6353 Hosts page: filtering by hostname sometimes displays incorrect result after overlay
goes away (but eventually catches up). (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e04dc67a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e04dc67a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e04dc67a

Branch: refs/heads/trunk
Commit: e04dc67a6d5960ffc8ea50e68d4fcea501869a98
Parents: c9fe537
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Wed Jul 2 16:34:12 2014 +0300
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Wed Jul 2 17:48:17 2014 +0300

----------------------------------------------------------------------
 .../app/mixins/common/tableServerProvider.js      | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e04dc67a/ambari-web/app/mixins/common/tableServerProvider.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/tableServerProvider.js b/ambari-web/app/mixins/common/tableServerProvider.js
index 76e1693..113f24e 100644
--- a/ambari-web/app/mixins/common/tableServerProvider.js
+++ b/ambari-web/app/mixins/common/tableServerProvider.js
@@ -24,6 +24,8 @@ App.TableServerProvider = Em.Mixin.create({
   updaterBinding: 'App.router.updateController',
   filteringComplete: true,
   filterConditions: [],
+  filterWaitingTime: 500,
+  timeOut: null,
   /**
    * total number of entities in table
    */
@@ -48,9 +50,6 @@ App.TableServerProvider = Em.Mixin.create({
    */
   refresh: function () {
     var self = this;
-
-    if (!this.get('filteringComplete')) return false;
-
     this.set('filteringComplete', false);
     var updaterMethodName = this.get('updater.tableUpdaterMap')[this.get('tableName')];
     this.get('updater')[updaterMethodName](function () {
@@ -83,8 +82,17 @@ App.TableServerProvider = Em.Mixin.create({
    * @param type {String}
    */
   updateFilter: function (iColumn, value, type) {
-    this.saveFilterConditions(iColumn, value, type, false);
-    this.refresh();
+    var self = this;
+    if (!this.get('filteringComplete')) {
+      clearTimeout(this.get('timeOut'));
+      this.set('timeOut', setTimeout(function() {
+        self.updateFilter(iColumn, value, type);
+      }, this.get('filterWaitingTime')));
+    } else {
+      clearTimeout(this.get('timeOut'));
+      this.saveFilterConditions(iColumn, value, type, false);
+      this.refresh();
+    }
   },
 
   /**


Mime
View raw message