summaryrefslogtreecommitdiff
path: root/horizon/static/framework/util/navigations/navigations.service.js
diff options
context:
space:
mode:
Diffstat (limited to 'horizon/static/framework/util/navigations/navigations.service.js')
-rw-r--r--horizon/static/framework/util/navigations/navigations.service.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/horizon/static/framework/util/navigations/navigations.service.js b/horizon/static/framework/util/navigations/navigations.service.js
index 8da8746c0..5d7a3571f 100644
--- a/horizon/static/framework/util/navigations/navigations.service.js
+++ b/horizon/static/framework/util/navigations/navigations.service.js
@@ -25,6 +25,7 @@
collapseAllNavigation: collapseAllNavigation,
expandNavigationByUrl: expandNavigationByUrl,
setBreadcrumb: setBreadcrumb,
+ setAbsoluteURI: setAbsoluteURI,
isNavigationExists: isNavigationExists
};
@@ -107,6 +108,14 @@
});
}
+ /* set absolute uri */
+ function setAbsoluteURI(webroot, url) {
+ if (webroot.endsWith("/") && url.startsWith("/")) {
+ webroot = webroot.slice(0, -1);
+ }
+ return webroot + url;
+ }
+
/* check whether navigation exists from url */
function isNavigationExists(url) {
return angular.element("a.openstack-panel[href='" + url + "']").length ? true : false;