+
{{ title }}
diff --git a/src/ui/public/chrome/directives/global_nav/global_nav_link/global_nav_link.js b/src/ui/public/chrome/directives/global_nav/global_nav_link/global_nav_link.js
new file mode 100644
index 00000000000000..17c9a0664672d4
--- /dev/null
+++ b/src/ui/public/chrome/directives/global_nav/global_nav_link/global_nav_link.js
@@ -0,0 +1,35 @@
+
+import globalNavLinkTemplate from './global_nav_link.html';
+import './global_nav_link.less';
+import uiModules from 'ui/modules';
+
+const module = uiModules.get('kibana');
+
+module.directive('globalNavLink', chrome => {
+ return {
+ restrict: 'E',
+ replace: true,
+ scope: {
+ isActive: '=',
+ isDisabled: '=',
+ tooltipContent: '=',
+ onClick: '&',
+ href: '=',
+ kbnRoute: '=',
+ icon: '=',
+ title: '=',
+ },
+ template: globalNavLinkTemplate,
+ link: scope => {
+ scope.getHref = () => {
+ if (scope.href) {
+ return scope.href;
+ }
+
+ if (scope.kbnRoute) {
+ return chrome.addBasePath(scope.kbnRoute);
+ }
+ };
+ }
+ };
+});
diff --git a/src/ui/public/chrome/directives/app_switcher_link/app_switcher_link.less b/src/ui/public/chrome/directives/global_nav/global_nav_link/global_nav_link.less
similarity index 61%
rename from src/ui/public/chrome/directives/app_switcher_link/app_switcher_link.less
rename to src/ui/public/chrome/directives/global_nav/global_nav_link/global_nav_link.less
index c2b84d83767811..d14f1b31d1238a 100644
--- a/src/ui/public/chrome/directives/app_switcher_link/app_switcher_link.less
+++ b/src/ui/public/chrome/directives/global_nav/global_nav_link/global_nav_link.less
@@ -1,14 +1,15 @@
@import (reference) "~ui/styles/variables";
-.app-switcher-link {
- width: @as-open-width;
+.global-nav-link {
+ position: relative;
+ width: @as-closed-width;
height: @app-icon-height;
line-height: @app-line-height;
- &.is-app-switcher-link-disabled {
+ &.is-global-nav-link-disabled {
opacity: 0.5;
- .app-switcher-link__anchor {
+ .global-nav-link__anchor {
cursor: default;
}
}
@@ -17,27 +18,30 @@
&.active {
background-color: @app-links-active-background;
- .app-switcher-link__anchor {
+ .global-nav-link__anchor {
color: @white;
text-decoration: none;
}
}
}
- .app-switcher-link__anchor {
+.is-global-nav-open {
+ .global-nav-link {
+ width: @as-open-width;
+ }
+}
+
+ .global-nav-link__anchor {
display: block;
height: 100%;
color: #ebf7fa;
- /**
- * 1. TODO: Override anchor styles. Fix this by removing a tag styles.
- */
&:focus {
- color: #ebf7fa; /* 1 */
+ color: @white;
}
}
- .app-switcher-link__icon {
+ .global-nav-link__icon {
display: inline-block;
width: @as-closed-width;
height: @app-icon-height;
@@ -49,7 +53,7 @@
/**
* This imgae is used to display the icon.
*/
- .app-switcher-link__icon-image {
+ .global-nav-link__icon-image {
height: 18px;
margin-top: 8px;
filter: invert(100%);
@@ -58,20 +62,33 @@
/**
* This placeholder text gets shown if there is no specified icon.
*/
- .app-switcher-link__icon-placeholder {
+ .global-nav-link__icon-placeholder {
line-height: @app-icon-height;
background-position: center;
background-size: contain;
background-repeat: no-repeat;
}
- .app-switcher-link__title {
+ .global-nav-link__title {
+ display: none;
width: calc(@as-open-width - @as-closed-width);
- display: inline-block;
float: right;
font-size: 0.9em;
text-align: left;
padding-left: 3px;
line-height: @app-icon-height;
white-space: nowrap;
+
+ .is-global-nav-open & {
+ display: inline-block;
+ }
}
+
+.global-nav-link--close {
+ /**
+ * 1. Translation accounts for the icon image being slightly off-center.
+ */
+ .global-nav-link__icon {
+ transform: translateX(1px) scaleX(-1); /* 1 */
+ }
+}
diff --git a/src/ui/public/chrome/directives/index.js b/src/ui/public/chrome/directives/index.js
index 7be137eb525393..3b91849fc78f53 100644
--- a/src/ui/public/chrome/directives/index.js
+++ b/src/ui/public/chrome/directives/index.js
@@ -1,5 +1,6 @@
-import './app_switcher';
-import './app_switcher_link';
+
+import './global_nav';
+
import kbnChromeProv from './kbn_chrome';
import kbnChromeNavControlsProv from './append_nav_controls';
import './kbn_loading_indicator';
diff --git a/src/ui/public/chrome/directives/kbn_chrome.html b/src/ui/public/chrome/directives/kbn_chrome.html
new file mode 100644
index 00000000000000..051ad5dd2558ff
--- /dev/null
+++ b/src/ui/public/chrome/directives/kbn_chrome.html
@@ -0,0 +1,21 @@
+
diff --git a/src/ui/public/chrome/directives/kbn_chrome.js b/src/ui/public/chrome/directives/kbn_chrome.js
index b2d70eb967d7fd..3a839f2b9e6b37 100644
--- a/src/ui/public/chrome/directives/kbn_chrome.js
+++ b/src/ui/public/chrome/directives/kbn_chrome.js
@@ -1,15 +1,16 @@
import $ from 'jquery';
+import './kbn_chrome.less';
import UiModules from 'ui/modules';
export default function (chrome, internals) {
UiModules
.get('kibana')
- .directive('kbnChrome', function ($rootScope) {
+ .directive('kbnChrome', $rootScope => {
return {
template($el) {
- const $content = $(require('ui/chrome/chrome.html'));
+ const $content = $(require('./kbn_chrome.html'));
const $app = $content.find('.application');
if (internals.rootController) {
@@ -43,6 +44,7 @@ export default function (chrome, internals) {
// and some local values
chrome.httpActive = $http.pendingRequests;
$scope.notifList = require('ui/notify')._notifs;
+
return chrome;
}
};
diff --git a/src/ui/public/chrome/directives/kbn_chrome.less b/src/ui/public/chrome/directives/kbn_chrome.less
new file mode 100644
index 00000000000000..1e3d82bac109d8
--- /dev/null
+++ b/src/ui/public/chrome/directives/kbn_chrome.less
@@ -0,0 +1,34 @@
+
+@import (reference) "~ui/styles/mixins";
+@import (reference) "~ui/styles/variables";
+
+body { overflow-x: hidden; }
+
+.app-wrapper {
+ .real-flex-parent();
+ position: absolute;
+ left: @as-closed-width;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 1;
+ margin: 0 auto;
+ background-color: #fff;
+
+ /**
+ * 1. Dirty, but we need to override the .is-global-nav-open state
+ * when we're looking at the log-in screen.
+ */
+ &.hidden-chrome {
+ left: 0 !important; /* 1 */
+ }
+
+ .navbar-right {
+ margin-right: 0;
+ }
+}
+
+ .app-wrapper-panel {
+ .flex-parent(@shrink: 0);
+ box-shadow: -4px 0px 3px rgba(0,0,0,0.2);
+ }
diff --git a/src/ui/public/chrome/services/global_nav_state.js b/src/ui/public/chrome/services/global_nav_state.js
new file mode 100644
index 00000000000000..c236ef35a65ac6
--- /dev/null
+++ b/src/ui/public/chrome/services/global_nav_state.js
@@ -0,0 +1,18 @@
+
+import modules from 'ui/modules';
+import angular from 'angular';
+
+modules.get('kibana')
+.service('globalNavState', (localStorage, $rootScope) => {
+ return {
+ isOpen: () => {
+ return localStorage.get('kibana.isGlobalNavOpen');
+ },
+
+ setOpen: isOpen => {
+ localStorage.set('kibana.isGlobalNavOpen', isOpen);
+ $rootScope.$broadcast('globalNavState:change');
+ return isOpen;
+ }
+ };
+});
diff --git a/src/ui/public/chrome/services/index.js b/src/ui/public/chrome/services/index.js
new file mode 100644
index 00000000000000..4bac1c4cc8cdd5
--- /dev/null
+++ b/src/ui/public/chrome/services/index.js
@@ -0,0 +1 @@
+import './global_nav_state';
diff --git a/src/ui/public/styles/variables/for-theme.less b/src/ui/public/styles/variables/for-theme.less
index 8f49e090bf361e..fced987036a104 100644
--- a/src/ui/public/styles/variables/for-theme.less
+++ b/src/ui/public/styles/variables/for-theme.less
@@ -342,7 +342,5 @@
@as-closed-width: 53px;
@app-icon-height: 38px;
@app-line-height: 24px;
-@transition-time: .35s;
-@transition-delay: .25s;
@app-links-wrapper-background: #3caed2;
@app-links-active-background: #2f99c1;