Merge pull request #2589 from laf/issue-2580

Added option to disable lazy loading of images
This commit is contained in:
Daniel Preussker
2015-12-09 18:05:07 +00:00
4 changed files with 19 additions and 1 deletions

View File

@@ -461,6 +461,7 @@ function generate_graph_tag($args) {
}//end generate_graph_tag()
function generate_lazy_graph_tag($args) {
global $config;
$urlargs = array();
$w = 0;
$h = 0;
@@ -476,7 +477,12 @@ function generate_lazy_graph_tag($args) {
$urlargs[] = $key."=".urlencode($arg);
}
return '<img class="lazy graphs" width="'.$w.'" height="'.$h.'" data-original="graph.php?' . implode('&amp;',$urlargs).'" border="0" />';
if ($config['enable_lazy_load'] === true) {
return '<img class="lazy graphs" width="'.$w.'" height="'.$h.'" data-original="graph.php?' . implode('&amp;',$urlargs).'" border="0" />';
}
else {
return '<img class="graphs" width="'.$w.'" height="'.$h.'" src="graph.php?' . implode('&amp;',$urlargs).'" border="0" />';
}
}//end generate_lazy_graph_tag()

View File

@@ -165,8 +165,14 @@ else {
<script src="js/jquery.bootgrid.min.js"></script>
<script src="js/handlebars.min.js"></script>
<script src="js/pace.min.js"></script>
<?php
if ($config['enable_lazy_load'] === true) {
?>
<script src="js/jquery.lazyload.min.js"></script>
<script src="js/lazyload.js"></script>
<?php
}
?>
<script src="js/librenms.js"></script>
<script type="text/javascript">