summaryrefslogtreecommitdiffstats
path: root/frontends/php/js/sbinit.js
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-17 10:31:32 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-17 10:31:32 +0000
commitcd6be85dfcfccb202f2d2a9ca9db062725e45d5c (patch)
tree8cff91acb5f13d9e0c9d419a5d459cdc24994f53 /frontends/php/js/sbinit.js
parent9fd54f156ece1cf8cec230705fa14d6d75db8efb (diff)
downloadzabbix-cd6be85dfcfccb202f2d2a9ca9db062725e45d5c.tar.gz
zabbix-cd6be85dfcfccb202f2d2a9ca9db062725e45d5c.tar.xz
zabbix-cd6be85dfcfccb202f2d2a9ca9db062725e45d5c.zip
- [DEV-137] fixes in graph zoom (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5631 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/js/sbinit.js')
-rw-r--r--frontends/php/js/sbinit.js31
1 files changed, 11 insertions, 20 deletions
diff --git a/frontends/php/js/sbinit.js b/frontends/php/js/sbinit.js
index 348316c4..951cfafc 100644
--- a/frontends/php/js/sbinit.js
+++ b/frontends/php/js/sbinit.js
@@ -130,14 +130,13 @@ function graph_zoom_init(graph_id,stime,period,width,height){
A_SBOX[graph_id].sbox = sbox_init(stime,period);
A_SBOX[graph_id].sbox.sbox_id = graph_id;
- var igraph = $(graph_id);
- var posxy = getPosition(igraph);
-
+ var igraph = $(graph_id);
var boxongraph = create_box_on_obj(igraph.parentNode);
- boxongraph.style.top = (posxy.top+A_SBOX[graph_id].shiftT)+'px';
- boxongraph.style.left = (posxy.left+A_SBOX[graph_id].shiftL-1)+'px';
+ A_SBOX[graph_id].sbox.dom_obj = boxongraph;
+ A_SBOX[graph_id].sbox.moveSBoxByObj(igraph);
+
width = width || 900;
height = height || 200;
@@ -149,32 +148,24 @@ function graph_zoom_init(graph_id,stime,period,width,height){
boxongraph.style.height = A_SBOX[graph_id].sbox.obj.height+'px';
boxongraph.style.width = A_SBOX[graph_id].sbox.obj.width+'px';
-
- posxy = getPosition(boxongraph);
-
- A_SBOX[graph_id].sbox.obj.left = parseInt(posxy.left);
- A_SBOX[graph_id].sbox.obj.top = parseInt(posxy.top);
-
- A_SBOX[graph_id].sbox.dom_obj = boxongraph;
+// Listeners
+ addListener(window,'resize',A_SBOX[graph_id].sbox.moveSBoxByObj.bindAsEventListener(A_SBOX[graph_id].sbox,igraph));
+
if(IE){
-// boxongraph.attachEvent('onmousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox));
igraph.attachEvent('onmousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox));
-// boxongraph.attachEvent('onmousemove',A_SBOX[graph_id].sbox.mousemove.bindAsEventListener(A_SBOX[graph_id].sbox));
igraph.onmousemove = A_SBOX[graph_id].sbox.mousemove.bind(A_SBOX[graph_id].sbox);
- document.attachEvent('onmouseup',A_SBOX[graph_id].sbox.mouseup.bindAsEventListener(A_SBOX[graph_id].sbox));
}
else if(OP){
boxongraph.addEventListener('mousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox),false);
boxongraph.onmousemove = A_SBOX[graph_id].sbox.mousemove.bind(A_SBOX[graph_id].sbox);
- document.addEventListener('mouseup',A_SBOX[graph_id].sbox.mouseup.bindAsEventListener(A_SBOX[graph_id].sbox),true);
}
else{
- boxongraph.addEventListener('mousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox),false);
- boxongraph.onmousemove = A_SBOX[graph_id].sbox.mousemove.bind(A_SBOX[graph_id].sbox);
- document.addEventListener('mouseup',A_SBOX[graph_id].sbox.mouseup.bindAsEventListener(A_SBOX[graph_id].sbox),true);
+ boxongraph.addEventListener('mousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox),false);
+ boxongraph.addEventListener('mousemove',A_SBOX[graph_id].sbox.mousemove.bindAsEventListener(A_SBOX[graph_id].sbox),false);
}
-
+
+ addListener(document,'mouseup',A_SBOX[graph_id].sbox.mouseup.bindAsEventListener(A_SBOX[graph_id].sbox),true);
A_SBOX[graph_id].sbox.sboxload = sboxload;
}