source: drbl_ui/flow_chart/clonezilla_select_flow_chart.files/gif_1.js @ 21

Last change on this file since 21 was 21, checked in by chris, 16 years ago
File size: 2.0 KB
Line 
1function ViewMgrSetRasterLocation(pageID, shapeID, pinX, pinY)
2{
3  clickMenu ();
4
5  var rasterImage = document.images("RasterImage");
6
7  var imageLeft = 0;
8  var imageRight = imageLeft + rasterImage.offsetWidth;
9  var imageTop = 0;
10  var imageBottom = imageTop + rasterImage.offsetHeight;
11 
12  var xLong = parent.ConvertXorYCoordinate(pinX, viewMgr.visBBoxLeft, viewMgr.visBBoxRight, imageLeft, imageRight, 0);
13  var yLong = parent.ConvertXorYCoordinate(pinY, viewMgr.visBBoxBottom, viewMgr.visBBoxTop, imageTop, imageBottom, 1);
14 
15  var pixelWidth = document.body.scrollWidth;
16  var pixelHeight = document.body.scrollHeight;
17
18  var clientWidth = document.body.clientWidth;
19  var clientHeight = document.body.clientHeight;
20  var halfClientWidth = clientWidth;
21  var halfClientHeight = clientHeight;
22
23  xLong = xLong + rasterImage.offsetLeft;
24  yLong = yLong + rasterImage.offsetTop;
25  var xScrollAmount = 0;
26  var yScrollAmount = 0;
27
28  var xPrevScrollAmount = document.body.scrollLeft;
29  var yPrevScrollAmount = document.body.scrollTop;
30
31  var arrowHalfWidth = arrowdiv.clientWidth / 2;
32  var arrowHeight = arrowdiv.clientHeight;
33
34  if ((xLong - arrowHalfWidth) < xPrevScrollAmount)
35  {
36    // X off left of screen.
37    document.body.scrollLeft = xLong - arrowHalfWidth;
38  }
39  else if ((xLong + arrowHalfWidth) > (clientWidth + xPrevScrollAmount))
40  {
41    // X off right of screen.
42    document.body.scrollLeft = xLong - clientWidth + xPrevScrollAmount + arrowHalfWidth;
43  }
44
45  if (yLong < yPrevScrollAmount)
46  {
47    // Y off top of screen.
48    document.body.scrollTop = yLong;
49  }
50  else if ((yLong + arrowHeight) > (clientHeight + yPrevScrollAmount))
51  {
52    // Y off bottom of screen.
53    document.body.scrollTop = yLong - clientHeight + yPrevScrollAmount + arrowHeight;
54  }
55
56  arrowdiv.style.posLeft = xLong - arrowHalfWidth;
57  arrowdiv.style.posTop = yLong;
58  arrowdiv.style.visibility = "visible";
59
60  setTimeout( "parent.hideObject(arrowdiv)", 0 );
61  setTimeout( "parent.showObject(arrowdiv)", 1 );
62  setTimeout( "parent.hideObject(arrowdiv)", 2000 );
63}
64
Note: See TracBrowser for help on using the repository browser.