Repository: ambari Updated Branches: refs/heads/trunk 492497e9f -> 0458940b9
AMBARI-17732 'Advanced hive-atlas-application.properties' is not opened by default upon using properties filter. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0458940b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0458940b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0458940b Branch: refs/heads/trunk Commit: 0458940b9308c2c95f14be59da974700894bf991 Parents: 492497e Author: ababiichuk <[email protected]> Authored: Fri Jul 15 14:08:11 2016 +0300 Committer: ababiichuk <[email protected]> Committed: Fri Jul 15 15:29:24 2016 +0300 ---------------------------------------------------------------------- .../configs/service_configs_by_category_view.js | 23 ++++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0458940b/ambari-web/app/views/common/configs/service_configs_by_category_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/configs/service_configs_by_category_view.js b/ambari-web/app/views/common/configs/service_configs_by_category_view.js index bdd0530..964e193 100644 --- a/ambari-web/app/views/common/configs/service_configs_by_category_view.js +++ b/ambari-web/app/views/common/configs/service_configs_by_category_view.js @@ -229,6 +229,10 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri * @method filteredCategoryConfigs */ filteredCategoryConfigs: function () { + Em.run.once(this, 'collapseCategory'); + }.observes('[email protected]'), + + collapseCategory: function () { $('.popover').remove(); var filter = this.get('parentView.filter').toLowerCase(); var filteredResult = this.get('categoryConfigs'); @@ -243,21 +247,16 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri this.set('category.collapsedByDefault', this.get('category.isCollapsed')); } this.set('category.isCollapsed', !filteredResult.length); + } else if (typeof this.get('category.collapsedByDefault') !== 'undefined') { + // If user clear filter -- restore defaults + this.set('category.isCollapsed', this.get('category.collapsedByDefault')); + this.set('category.collapsedByDefault', undefined); + } else if (isInitialRendering && !filteredResult.length) { + this.set('category.isCollapsed', true); } - else - if (typeof this.get('category.collapsedByDefault') !== 'undefined') { - // If user clear filter -- restore defaults - this.set('category.isCollapsed', this.get('category.collapsedByDefault')); - this.set('category.collapsedByDefault', undefined); - } - else - if (isInitialRendering && !filteredResult.length) { - this.set('category.isCollapsed', true); - } - var categoryBlock = $('.' + this.get('category.name').split(' ').join('.') + '>.accordion-body'); this.get('category.isCollapsed') ? categoryBlock.hide() : categoryBlock.show(); - }.observes('categoryConfigs', 'parentView.filter', '[email protected]'), + }, /** * sort configs in current category by index
