You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rz...@apache.org on 2016/09/09 21:06:28 UTC
ambari git commit: AMBARI-17663 - Hosts page: JS error when sorting
(rzang)
Repository: ambari
Updated Branches:
refs/heads/branch-2.5 53a1dc2cf -> 23fdb9573
AMBARI-17663 - Hosts page: JS error when sorting (rzang)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/23fdb957
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/23fdb957
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/23fdb957
Branch: refs/heads/branch-2.5
Commit: 23fdb95738433a6eb721cee2c3f1976fbd0c701f
Parents: 53a1dc2c
Author: Richard Zang <rz...@apache.org>
Authored: Mon Jul 11 17:55:18 2016 -0700
Committer: Richard Zang <rz...@apache.org>
Committed: Fri Sep 9 14:01:45 2016 -0700
----------------------------------------------------------------------
ambari-web/app/views/common/sort_view.js | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/23fdb957/ambari-web/app/views/common/sort_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/sort_view.js b/ambari-web/app/views/common/sort_view.js
index bbb6004..0fc1db7 100644
--- a/ambari-web/app/views/common/sort_view.js
+++ b/ambari-web/app/views/common/sort_view.js
@@ -330,15 +330,16 @@ var fieldView = Em.View.extend({
*/
click: function (event) {
var wrapperView = this.get('parentView');
- var currentObserverProperty = this.get('controller.sortingColumn.name');
wrapperView.sort(this, (this.get('status') !== 'sorting_desc'));
// add observer for sorting property key to apply sorting if some value will be changed
- if (currentObserverProperty) {
- wrapperView.removeSortingObserver(currentObserverProperty);
+ if (wrapperView.addSortingObserver && wrapperView.removeSortingObserver) {
+ var currentObserverProperty = this.get('controller.sortingColumn.name');
+ if (currentObserverProperty) {
+ wrapperView.removeSortingObserver(currentObserverProperty);
+ }
+ wrapperView.addSortingObserver(this.get('name'));
}
-
- wrapperView.addSortingObserver(this.get('name'));
this.get('controller').set('sortingColumn', this);
}
});