Browse Source

AMBARI-4542. Customize Services: Advanced configs show up with wrong caret after adding new property. (xiwang via yusaku)

Yusaku Sako 11 years ago
parent
commit
a3844f930b

+ 1 - 1
ambari-web/app/templates/common/configs/service_config.hbs

@@ -90,7 +90,7 @@
                 <a class="accordion-toggle">{{category.displayName}}</a>
             </div>
 
-            <div class="accordion-body collapse in">
+            <div class="accordion-body collapse in" {{bindAttr style="view.isCategoryBodyVisible"}}>
               <div class="accordion-inner service-config-section">
                 <form class="form-horizontal" autocomplete="off">
 

+ 10 - 0
ambari-web/app/views/common/configs/services_config.js

@@ -411,6 +411,16 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({
       self.updateReadOnlyFlags();
     });
   },
+
+  /**
+   * Should we show current category accordion-body, based on category.isCollapsed property.
+   * If added/removed a serverConfigObject, this property got updated.
+   * Without this property, all serviceConfigs Objects will show up even if some was collapsed before.
+   */
+  isCategoryBodyVisible: function () {
+    return this.get('category.isCollapsed')? "display: none;" : "display: block;"
+  }.property('serviceConfigs.length'),
+
   childView: App.ServiceConfigsOverridesView,
   changeFlag: Ember.Object.create({
     val: 1