diff options
author | Stef Walter <stef@memberwebs.com> | 2006-01-22 02:39:34 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-01-22 02:39:34 +0000 |
commit | c54e18a960bef59479a981cb66eddecf8a7108fe (patch) | |
tree | 7b4deab0b10e5d01d8f05b5b2c393ce9eb6571da /html | |
parent | ec327cbb34922c125c3dac2c4757af380200f44a (diff) |
Put a wait pointer while waiting for images to transfer.
Diffstat (limited to 'html')
-rw-r--r-- | html/rrdui.js | 44 | ||||
-rw-r--r-- | html/style.css | 1 |
2 files changed, 42 insertions, 3 deletions
diff --git a/html/rrdui.js b/html/rrdui.js index ad056d5..f1c7286 100644 --- a/html/rrdui.js +++ b/html/rrdui.js @@ -47,12 +47,19 @@ function loadedGraphData(doc) * GRAPHS */ +function getFrameDocument() +{ + var frame = document.getElementById("main-frame"); + /* COMPAT: IE and Mozilla access the content of frames differently */ + return frame.contentDocument ? frame.contentDocument : frame.contentWindow.document; +} + function setupFrame() { + gdoc = getFrameDocument(); var frame = document.getElementById("main-frame"); /* COMPAT: IE and Mozilla access the content of frames differently */ - gdoc = frame.contentDocument ? frame.contentDocument : frame.contentWindow.document; - gwindow = frame.contentWindow ? frame.contentWindow : frame.contentDocument.window; + gwindow = frame.contentDocument ? frame.contentDocument.defaultView : frame.contentWindow; } function displayCurrentPage() @@ -109,6 +116,7 @@ function displayCurrentPage() img.className = "graph"; img.id = id; + img.style.cursor = "crosshair"; area.appendChild(img); @@ -147,9 +155,31 @@ function reloadGraph(img) /* Size */ uri += "&height=" + GRAPH_HEIGHT + "&width=" + GRAPH_WIDTH; + img._loading = true; + updateCursors(img); + img.onload = new Function("reloadedGraph('" + img.id + "');"); img.setAttribute("src", uri); } +function reloadedGraph(id) +{ + var img = getFrameDocument().getElementById(id); + img._loading = false; + updateCursors(img); +} + +function updateCursors(img) +{ + if(img._actions) + { + var i, acts = img._actions.getElementsByTagName("img"); + for(i = 0; i < acts.length; i++) + acts.item(i).style.cursor = img._loading ? "wait" : "pointer"; + } + + img.style.cursor = img._loading ? "wait" : "crosshair"; +} + function zoomGraphStart(evt) { /* COMPAT: In IE the left button is 1, Mozilla is 0 */ @@ -332,7 +362,16 @@ function actionsDisplay(evt) return; var actions = gdoc.getElementById("actions"); + + /* Disconnect from previous image */ + if(actions._img) + actions._img._actions = null; + + /* Attach to this image */ actions._img = img; + img._actions = actions; + updateCursors(img); + actions._display = true; actions.style.top = img.offsetTop; @@ -368,6 +407,7 @@ function actionsHide(evt) actions.style.display = "none"; img.onmouseout = actions.onmouseout = null; + img._actions = null; actions._img = null; actions._display = false; } diff --git a/html/style.css b/html/style.css index 7ff1ed7..b72e4ca 100644 --- a/html/style.css +++ b/html/style.css @@ -77,7 +77,6 @@ body.in-frame img.graph { - cursor: crosshair; margin: 7px; } |