diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2007-08-20 17:54:05 +0200 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2007-08-20 17:54:05 +0200 |
commit | c2701cd9f6ce10f7b92a997559e64ca7c516cd8c (patch) | |
tree | e9aee1daf06691602e607c59efe6852420a715d3 /htdocs | |
parent | 16b678a3b085fea2b60aceb6c489439b4eba0a4b (diff) | |
download | smokeping-c2701cd9f6ce10f7b92a997559e64ca7c516cd8c.tar.gz smokeping-c2701cd9f6ce10f7b92a997559e64ca7c516cd8c.tar.xz |
execute js code only if there is a #zoom image
Diffstat (limited to 'htdocs')
-rw-r--r-- | htdocs/js/smokeping_zoom.js | 14 |
1 files 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('<div id="selector" oncontextmenu="return false"></div>') - 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('<div id="selector" oncontextmenu="return false"></div>') + 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) |