Repository: ambari Updated Branches: refs/heads/trunk 922cf0773 -> ad1ad9318
AMBARI-10455. Multible active tabs showing on service config section (Richard Zang via srimanth) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ad1ad931 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ad1ad931 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ad1ad931 Branch: refs/heads/trunk Commit: ad1ad93181a569213364668c995af423ea97698d Parents: 922cf07 Author: Srimanth Gunturi <sgunt...@hortonworks.com> Authored: Mon Apr 13 20:55:09 2015 -0700 Committer: Srimanth Gunturi <sgunt...@hortonworks.com> Committed: Mon Apr 13 20:55:09 2015 -0700 ---------------------------------------------------------------------- .../configs/service_config_layout_tab_view.js | 8 +------- .../app/views/common/configs/service_config_view.js | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ad1ad931/ambari-web/app/views/common/configs/service_config_layout_tab_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/service_config_layout_tab_view.js b/ambari-web/app/views/common/configs/service_config_layout_tab_view.js index 98a0e8d..9e48ab0 100644 --- a/ambari-web/app/views/common/configs/service_config_layout_tab_view.js +++ b/ambari-web/app/views/common/configs/service_config_layout_tab_view.js @@ -189,13 +189,7 @@ App.ServiceConfigLayoutTabView = Em.View.extend(App.ConfigOverridable, { } } // no more active tab? pick the first non hidden tab and make it active - var activeTab = this.get('parentView.tabs').findProperty('isActive', true); - if (!activeTab) { - var nonHiddenTabs = this.get('parentView.tabs').filter(function (tab) { - return !(tab.get('isHiddenByFilter') === true); - }); - nonHiddenTabs.get('firstObject').set('isActive', true); - } + this.get('parentView').pickActiveTab(this.get('parentView.tabs')); }.observes('parentView.filter', 'parentView.columns.@each.selected'), willInsertElement: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/ad1ad931/ambari-web/app/views/common/configs/service_config_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/service_config_view.js b/ambari-web/app/views/common/configs/service_config_view.js index 97d74f3..1db6d59 100644 --- a/ambari-web/app/views/common/configs/service_config_view.js +++ b/ambari-web/app/views/common/configs/service_config_view.js @@ -109,12 +109,24 @@ App.ServiceConfigView = Em.View.extend({ } var tabs = App.Tab.find().filterProperty('serviceName', this.get('controller.selectedService.serviceName')); this.processTabs(tabs); - // make first tab active - tabs.get('firstObject').set('isActive', true); + this.pickActiveTab(tabs); return tabs; }.property('controller.selectedService.serviceName'), /** + * Pick the first non hidden tab and make it active when there is no active tab + */ + pickActiveTab : function (tabs) { + var activeTab = tabs.findProperty('isActive', true); + if (!activeTab) { + var nonHiddenTabs = tabs.filter(function (tab) { + return !(tab.get('isHiddenByFilter') === true); + }); + nonHiddenTabs.get('firstObject').set('isActive', true); + } + }, + + /** * Data reordering before rendering. * Reorder all sections/subsections into rows based on their rowIndex * @param tabs