Parcourir la source

AMBARI-2114. Refresh on the Service page always activates summary tab. (jaimin)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1482169 13f79535-47bb-0310-9956-ffa450edef68
Jaimin Jetly il y a 12 ans
Parent
commit
a7245a2ce8

+ 2 - 0
CHANGES.txt

@@ -850,6 +850,8 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-2114. Refresh on the Service page always activates summary tab. (jaimin)
+
  AMBARI-2120. Add few logs to allow root-cause the issue where agent seems
  to unable to communicate with the server. (smohanty)
 

+ 4 - 0
ambari-web/app/utils/helper.js

@@ -20,6 +20,10 @@ String.prototype.trim = function () {
   return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
 };
 
+String.prototype.endsWith = function(suffix) {
+  return this.indexOf(suffix, this.length - suffix.length) !== -1;
+};
+
 /**
  * convert ip address string to long int
  * @return {*}

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

@@ -34,7 +34,7 @@ App.MainServiceInfoMenuView = Em.CollectionView.extend({
 
   activateView:function () {
     $.each(this._childViews, function () {
-      this.set('active', (this.get('content.routing') == 'summary' ? "active" : ""));
+      this.set('active', (document.URL.endsWith(this.get('content.routing')) ? "active" : ""));
     });
   },