Przeglądaj źródła

AMBARI-9241 Ambari Web highlighting option in Admin even though I'm not on that page. (atkach)

Andrii Tkach 10 lat temu
rodzic
commit
3b205d4f01

+ 7 - 1
ambari-web/app/controllers/main/admin.js

@@ -20,7 +20,13 @@ var App = require('app');
 
 App.MainAdminController = Em.Controller.extend({
   name: 'mainAdminController',
-  category: 'user',
+
+  /**
+   * @type {string}
+   * @default null
+   */
+  category: null,
+
   /**
    * Check if access page available.
    * Turn on if YARN service is installed with Application Timeline Server component and TEZ installed too.

+ 6 - 1
ambari-web/app/views/main/admin.js

@@ -57,6 +57,11 @@ App.MainAdminView = Em.View.extend({
     isActive: function () {
       return this.get('item') === this.get('parentView.selected');
     }.property('item', 'parentView.selected')
-  })
+  }),
+
+  willDestroyElement: function () {
+    //reset selected category in Admin sub-menu after leaving admin section
+    this.set('controller.category', null);
+  }
 });
 

+ 1 - 1
ambari-web/app/views/main/menu.js

@@ -147,7 +147,7 @@ App.MainMenuView = Em.CollectionView.extend({
       tagName: 'li',
       classNameBindings: 'isActive:active'.w(),
       isActive: function () {
-        return this.get('item').toLowerCase().contains(this.get('parentView.selectedAdminItem').toLowerCase());
+        return this.get('item') === this.get('parentView.selectedAdminItem');
       }.property('item', 'parentView.selectedAdminItem'),
 
       goToCategory: function (event) {