parent
4587f26476
commit
06296f29d8
|
@ -50,10 +50,14 @@ class InlinePie extends AbstractWidget
|
|||
* @var string
|
||||
*/
|
||||
private $template =<<<'EOD'
|
||||
<span class="sparkline" sparkTitle="{title}" sparkWidth="{width}" sparkHeight="{height}" style="{style}"
|
||||
sparkSliceColors="[{colors}]" values="{data}" sparkType="pie"></span>
|
||||
<noscript>
|
||||
<img class="inlinepie"
|
||||
title="{title}" src="{url}" style="width: {width}px; height: {height}px; {style}"
|
||||
data-icinga-colors="{colors}" data-icinga-values="{data}"
|
||||
/>
|
||||
</noscript>
|
||||
EOD;
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,10 +69,6 @@
|
|||
|
||||
$('input.autofocus', el).focus();
|
||||
|
||||
$('img.inlinepie', el).each(function() {
|
||||
icinga.ui.initializeSparklines($(this));
|
||||
});
|
||||
|
||||
// replace all sparklines
|
||||
$('span.sparkline', el).sparkline('html', { enableTagOptions: true });
|
||||
|
||||
|
|
|
@ -409,11 +409,6 @@
|
|||
|
||||
this.icinga.ui.initializeTriStates($resp);
|
||||
|
||||
// Replace images with sparklines.
|
||||
$resp.find('img.inlinepie').each(function(){
|
||||
self.icinga.ui.initializeSparklines($(this));
|
||||
});
|
||||
|
||||
/* Should we try to fiddle with responses containing full HTML? */
|
||||
/*
|
||||
if ($('body', $resp).length) {
|
||||
|
|
|
@ -631,32 +631,6 @@
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Search and replace all inlinepies with html for sparklines.
|
||||
*
|
||||
* @param parent
|
||||
*/
|
||||
initializeSparklines: function($container) {
|
||||
|
||||
// replace all remaining images with sparklines
|
||||
var title = $container.attr('title'),
|
||||
values = $container.data('icinga-values'),
|
||||
colors = $container.data('icinga-colors'),
|
||||
width = $container.css('width'),
|
||||
height = $container.css('height');
|
||||
if (!values) {
|
||||
return;
|
||||
}
|
||||
$container.replaceWith(
|
||||
'<span sparkTitle="' + title +
|
||||
'" sparkWidth="' + width +
|
||||
'" sparkHeight="' + height +
|
||||
'" sparkType="pie" sparkSliceColors="[' +
|
||||
colors + ']" values="' +
|
||||
values + '" class="sparkline"></span>'
|
||||
);
|
||||
},
|
||||
|
||||
initializeControls: function (parent) {
|
||||
|
||||
var self = this;
|
||||
|
|
Loading…
Reference in New Issue