From c2701cd9f6ce10f7b92a997559e64ca7c516cd8c Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Mon, 20 Aug 2007 15:54:05 +0000 Subject: execute js code only if there is a #zoom image --- htdocs/js/smokeping_zoom.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/htdocs/js/smokeping_zoom.js b/htdocs/js/smokeping_zoom.js index d06c867..df90e85 100644 --- a/htdocs/js/smokeping_zoom.js +++ b/htdocs/js/smokeping_zoom.js @@ -86,13 +86,12 @@ var mySelectBottom = 0; $(document).ready(function() { - var rrdimg = jQuery("img#zoom"); - - StartDateString = 0; - EndDateString = 0; - jQuery('body',document).append('
') - var selector = jQuery("div#selector"); + if (rrdimg.length){ // only do this if we actually have an zoom image + StartDateString = 0; + EndDateString = 0; + jQuery('body',document).append('
') + var selector = jQuery("div#selector"); selector.Selectable({ opacity : 1, @@ -112,8 +111,7 @@ $(document).ready(function() { padding: 0, 'z-index': 1000 }); - - + }; }); // will be started by modified iSelect (StopApply Function) -- cgit v1.2.3-24-g4f1b