diff --git a/src/ui/public/chrome/api/angular.js b/src/ui/public/chrome/api/angular.js index 91c35fb591c3..db003c08a171 100644 --- a/src/ui/public/chrome/api/angular.js +++ b/src/ui/public/chrome/api/angular.js @@ -45,7 +45,7 @@ module.exports = function (chrome, internals) { controller: function ($scope, $rootScope, $location, $http) { // 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 var onRouteChange = function () { diff --git a/src/ui/public/chrome/api/controls.js b/src/ui/public/chrome/api/controls.js index a8652ed59bf4..116e37411cff 100644 --- a/src/ui/public/chrome/api/controls.js +++ b/src/ui/public/chrome/api/controls.js @@ -10,6 +10,9 @@ module.exports = function (chrome, internals) { * 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 * @return {chrome} @@ -23,7 +26,7 @@ module.exports = function (chrome, internals) { * @return {boolean} - display state of the chrome */ chrome.getVisible = function () { - if (_.isUndefined(internals.visible)) return true; + if (_.isUndefined(internals.visible)) return def; return internals.visible; }; };