You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2015/05/25 18:11:20 UTC

ambari git commit: AMBARI-11368 Ambari view: Linking to a page inside an Ambari view is broken. (atkach)

Repository: ambari
Updated Branches:
  refs/heads/trunk a92cac157 -> be170909c


AMBARI-11368 Ambari view: Linking to a page inside an Ambari view is broken. (atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/be170909
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/be170909
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/be170909

Branch: refs/heads/trunk
Commit: be170909cf4fff290416f2ca00f5fc4b9e5416cd
Parents: a92cac1
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Mon May 25 14:59:20 2015 +0300
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Mon May 25 19:10:58 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/routes/views.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/be170909/ambari-web/app/routes/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/views.js b/ambari-web/app/routes/views.js
index 7b504e4..051d218 100644
--- a/ambari-web/app/routes/views.js
+++ b/ambari-web/app/routes/views.js
@@ -39,7 +39,9 @@ module.exports = Em.Route.extend({
       var href = ['/views', params.viewName, params.version, params.instanceName + "/"].join('/');
       var viewPath = this.parseViewPath(window.location.href.slice(window.location.href.indexOf('?')));
       if (viewPath) {
-        href = ['/views', params.viewName, params.version, params.instanceName.slice(0, params.instanceName.lastIndexOf('?'))].join('/');
+        href = ['/views', params.viewName, params.version, params.instanceName.slice(0, params.instanceName.lastIndexOf('?')) + "/"].join('/');
+        //remove slash from viewPath since href already contains it at the end
+        if (viewPath.charAt(0) === '/') viewPath = viewPath.slice(1);
       }
 
       router.get('mainViewsController').dataLoading().done(function() {