mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
parent
6a5efd560d
commit
fefdfe3d7b
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
(function(Icinga, $) {
|
(function(Icinga, $) {
|
||||||
|
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
Icinga.Behaviors = Icinga.Behaviors || {};
|
Icinga.Behaviors = Icinga.Behaviors || {};
|
||||||
|
|
||||||
@ -10,42 +10,17 @@
|
|||||||
Icinga.EventListener.call(this, icinga);
|
Icinga.EventListener.call(this, icinga);
|
||||||
this.on('rendered', this.onRendered, this);
|
this.on('rendered', this.onRendered, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
Sparkline.prototype = new Icinga.EventListener();
|
Sparkline.prototype = new Icinga.EventListener();
|
||||||
|
|
||||||
Sparkline.prototype.onRendered = function(evt) {
|
Sparkline.prototype.onRendered = function(e) {
|
||||||
var el = evt.target;
|
var el = e.target;
|
||||||
|
|
||||||
$('.sparkline', el).each(function(i, element) {
|
$(e.target).find('.sparkline').each(function() {
|
||||||
// read custom options
|
$(this).sparkline('html', {
|
||||||
var $spark = $(element);
|
|
||||||
var title = $spark.attr('title');
|
|
||||||
|
|
||||||
if ($spark.attr('labels')) {
|
|
||||||
$spark.removeAttr('original-title');
|
|
||||||
}
|
|
||||||
|
|
||||||
var options;
|
|
||||||
if ($spark.hasClass('sparkline-perfdata')) {
|
|
||||||
options = {
|
|
||||||
enableTagOptions: true,
|
enableTagOptions: true,
|
||||||
width: 16,
|
disableTooltips: true
|
||||||
height: 16,
|
});
|
||||||
title: title,
|
|
||||||
disableTooltips: true,
|
|
||||||
borderWidth: 1.4,
|
|
||||||
borderColor: '#FFF'
|
|
||||||
};
|
|
||||||
$spark.sparkline('html', options);
|
|
||||||
} else if ($spark.hasClass('sparkline-multi')) {
|
|
||||||
options = {
|
|
||||||
width: 100,
|
|
||||||
height: 100,
|
|
||||||
title: title,
|
|
||||||
enableTagOptions: true
|
|
||||||
};
|
|
||||||
$spark.sparkline('html', options);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user