mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix indenting, adding comments
This commit is contained in:
@ -1,27 +1,45 @@
|
||||
/*
|
||||
* LibreNMS module to initialize and support lazy loading of graph images
|
||||
*
|
||||
* Copyright (c) 2015 Travis Hegner <http://travishegner.com/>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
|
||||
$("img.lazy").load(lazyload_done).lazyload({
|
||||
effect: "fadeIn",
|
||||
threshold: 300,
|
||||
placeholder: ""
|
||||
|
||||
//initialize jquery lazyload for all '.lazy' img tags
|
||||
$("img.lazy").load(lazyload_done).lazyload({
|
||||
effect: "fadeIn",
|
||||
threshold: 300,
|
||||
placeholder: ""
|
||||
});
|
||||
|
||||
|
||||
//re-initializes images loaded after an ajax call
|
||||
$(document).ajaxStop(function() {
|
||||
$("img.lazy").load(lazyload_done).lazyload({
|
||||
effect: "fadeIn",
|
||||
threshold: 300,
|
||||
placeholder: ""
|
||||
threshold: 300,
|
||||
placeholder: ""
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//We have to wrap the original overlib library to remove the WxH attributes
|
||||
function wrap_overlib() {
|
||||
var ret = overlib.apply(null,arguments);
|
||||
$('div#overDiv img').removeAttr('width').removeAttr('height').removeClass('lazy');
|
||||
return ret;
|
||||
var ret = overlib.apply(null,arguments);
|
||||
//Since RRD takes the width and height params for only the canvas, we must unset them
|
||||
//from the final (larger) image to prevent the browser from resizing them.
|
||||
$('div#overDiv img').removeAttr('width').removeAttr('height').removeClass('lazy');
|
||||
return ret;
|
||||
}
|
||||
|
||||
function lazyload_done() {
|
||||
$(this).removeAttr('width').removeAttr('height').removeClass('lazy');
|
||||
//Since RRD takes the width and height params for only the canvas, we must unset them
|
||||
//from the final (larger) image to prevent the browser from resizing them.
|
||||
$(this).removeAttr('width').removeAttr('height').removeClass('lazy');
|
||||
}
|
Reference in New Issue
Block a user