Merge pull request #5335 from spalger/fix/chromeSetVisible
[chrome] let users call setVisible() before angular bootstrap
This commit is contained in:
commit
5e9e5c6bef
3 changed files with 6 additions and 3 deletions
2
src/ui/public/chrome/api/angular.js
vendored
2
src/ui/public/chrome/api/angular.js
vendored
|
@ -45,7 +45,7 @@ module.exports = function (chrome, internals) {
|
||||||
controller: function ($scope, $rootScope, $location, $http) {
|
controller: function ($scope, $rootScope, $location, $http) {
|
||||||
|
|
||||||
// are we showing the embedded version of the chrome?
|
// are we showing the embedded version of the chrome?
|
||||||
chrome.setVisible(!Boolean($location.search().embed));
|
internals.setVisibleDefault(!$location.search().embed);
|
||||||
|
|
||||||
// listen for route changes, propogate to tabs
|
// listen for route changes, propogate to tabs
|
||||||
var onRouteChange = function () {
|
var onRouteChange = function () {
|
||||||
|
|
5
src/ui/public/chrome/api/controls.js
vendored
5
src/ui/public/chrome/api/controls.js
vendored
|
@ -10,6 +10,9 @@ module.exports = function (chrome, internals) {
|
||||||
* determines if the Kibana chrome should be displayed
|
* determines if the Kibana chrome should be displayed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var def = true;
|
||||||
|
internals.setVisibleDefault = (_def) => def = Boolean(_def);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} display - should the chrome be displayed
|
* @param {boolean} display - should the chrome be displayed
|
||||||
* @return {chrome}
|
* @return {chrome}
|
||||||
|
@ -23,7 +26,7 @@ module.exports = function (chrome, internals) {
|
||||||
* @return {boolean} - display state of the chrome
|
* @return {boolean} - display state of the chrome
|
||||||
*/
|
*/
|
||||||
chrome.getVisible = function () {
|
chrome.getVisible = function () {
|
||||||
if (_.isUndefined(internals.visible)) return true;
|
if (_.isUndefined(internals.visible)) return def;
|
||||||
return internals.visible;
|
return internals.visible;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="content" chrome-context >
|
<div class="content" chrome-context >
|
||||||
<nav
|
<nav
|
||||||
ng-style="::{ background: chrome.getNavBackground() }"
|
ng-style="::{ background: chrome.getNavBackground() }"
|
||||||
ng-class="::{ show: chrome.getVisible() }"
|
ng-class="{ show: chrome.getVisible() }"
|
||||||
class="hide navbar navbar-inverse navbar-static-top">
|
class="hide navbar navbar-inverse navbar-static-top">
|
||||||
|
|
||||||
<!-- Mobile navbar -->
|
<!-- Mobile navbar -->
|
||||||
|
|
Loading…
Reference in a new issue