diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-10-31 11:28:41 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-10-31 11:28:41 +0000 |
| commit | 8dfc37f2248bff23f8328f714b06418fcfaaa8dc (patch) | |
| tree | 3acf1b9eb362a37f407abf267428c26b6157fe22 /frontends/php/include/js.inc.php | |
| parent | 5e4063517c2aba730d1aa2273754a85891375282 (diff) | |
| download | zabbix-8dfc37f2248bff23f8328f714b06418fcfaaa8dc.tar.gz zabbix-8dfc37f2248bff23f8328f714b06418fcfaaa8dc.tar.xz zabbix-8dfc37f2248bff23f8328f714b06418fcfaaa8dc.zip | |
- [DEV-54] added zoom for graphs (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@4951 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/js.inc.php')
| -rw-r--r-- | frontends/php/include/js.inc.php | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/frontends/php/include/js.inc.php b/frontends/php/include/js.inc.php index 781bc987..e5b1df96 100644 --- a/frontends/php/include/js.inc.php +++ b/frontends/php/include/js.inc.php @@ -55,9 +55,19 @@ function zbx_add_post_js($script) function get_js_sizeable_graph($url){ + return ' <script language="JavaScript" type="text/javascript"> <!-- + var ZBX_GZ_shiftT = 17; + var ZBX_GZ_shiftL = 10; + + var ZBX_G_WIDTH; + if(window.innerWidth) ZBX_G_WIDTH=window.innerWidth; + else ZBX_G_WIDTH=document.body.clientWidth; + + ZBX_G_WIDTH-= 80; + insert_sizeable_graph('.zbx_jsvalue($url).'); --> </script> @@ -73,14 +83,22 @@ function get_dynamic_chart($img_src,$width=0){ var width = "'.((!(is_int($width) && $width > 0)) ? $width : '').'"; var img_src = "'.$img_src.'"; + var ZBX_GZ_shiftT = 17; + var ZBX_GZ_shiftL = 10; + + var ZBX_G_WIDTH; + if(width!=""){ - var scr_width = 0; - if(document.body.clientWidth) - scr_width = document.body.clientWidth; - else - scr_width = document.width; - - width = "&width=" + (scr_width - 100 + parseInt(width)); + if(window.innerWidth) ZBX_G_WIDTH=window.innerWidth; + else ZBX_G_WIDTH=document.body.clientWidth; + + ZBX_G_WIDTH-= 80; + + ZBX_G_WIDTH+= parseInt(width); + width = "&width=" + ZBX_G_WIDTH; + } + else{ + ZBX_G_WIDTH = '.$width.'; } document.write(\'<img alt="chart" src="\'+img_src + width +\'" />\'); |
