UNPKG

@spalger/kibana

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

31 lines (26 loc) 944 B
define(function (require) { var _ = require('lodash'); var $ = require('jquery'); var $style = $('<style>').appendTo('head').attr('id', 'style-compile'); require('ui/config'); require('ui/modules') .get('kibana') .run(function ($rootScope, $compile, config) { var truncateGradientHeight = 15; var template = _.template(require('./styleCompile.css.tmpl')); var locals = {}; // watch the value of the truncate:maxHeight config param $rootScope.$watch(function () { return config.get('truncate:maxHeight'); }, function (maxHeight) { if (maxHeight > 0) { locals.truncateMaxHeight = maxHeight + 'px !important'; locals.truncateGradientTop = maxHeight - truncateGradientHeight + 'px'; } else { locals.truncateMaxHeight = 'none'; locals.truncateGradientTop = '-' + truncateGradientHeight + 'px'; } $style.html(template(locals)); }); }); });