kibana-123
Version:
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic
33 lines (28 loc) • 728 B
JavaScript
import _ from 'lodash';
module.exports = function (chrome, internals) {
/**
* ui/chrome Controls API
*
* Exposes controls for the Kibana chrome
*
* Visible
* determines if the Kibana chrome should be displayed
*/
let def = true;
internals.setVisibleDefault = (_def) => def = Boolean(_def);
/**
* @param {boolean} display - should the chrome be displayed
* @return {chrome}
*/
chrome.setVisible = function (display) {
internals.visible = Boolean(display);
return chrome;
};
/**
* @return {boolean} - display state of the chrome
*/
chrome.getVisible = function () {
if (_.isUndefined(internals.visible)) return def;
return internals.visible;
};
};