Repository: ambari Updated Branches: refs/heads/branch-1.6.1 2e5c7acf2 -> 543470f84
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/543470f8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/543470f8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/543470f8 Branch: refs/heads/branch-1.6.1 Commit: 543470f84fdc5cf1e140d38ac89a78e6a67f4aa4 Parents: 2e5c7ac Author: aBabiichuk <[email protected]> Authored: Wed Jul 2 16:31:42 2014 +0300 Committer: aBabiichuk <[email protected]> Committed: Wed Jul 2 17:48:49 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/543470f8/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(); + } }, /**
