notify w/blank message now fades existing notify out

This commit is contained in:
Andrew Dolgov 2006-05-19 06:44:23 +01:00
parent 6b9bf6c2f6
commit 0655a1d596
1 changed files with 12 additions and 9 deletions

View File

@ -85,7 +85,7 @@ function hide_notify() {
var n = notify_last_doc.getElementById("notify"); var n = notify_last_doc.getElementById("notify");
if (browser_has_opacity()) { if (browser_has_opacity()) {
if (notify_opacity >= 0) { if (notify_opacity >= 0) {
notify_opacity = notify_opacity - 0.2; notify_opacity = notify_opacity - 0.1;
n.style.opacity = notify_opacity; n.style.opacity = notify_opacity;
notify_hide_timerid = window.setTimeout("hide_notify()", 20); notify_hide_timerid = window.setTimeout("hide_notify()", 20);
} else { } else {
@ -105,8 +105,18 @@ function notify_real(msg, doc, no_hide, is_err) {
if (!n || !nb) return; if (!n || !nb) return;
if (notify_hide_timerid) {
window.clearTimeout(notify_hide_timerid);
}
notify_last_doc = doc;
notify_opacity = 1;
if (msg == "") { if (msg == "") {
n.style.display = "none"; if (n.style.display == "block") {
notify_hide_timerid = window.setTimeout("hide_notify()", 0);
}
return;
} else { } else {
n.style.display = "block"; n.style.display = "block";
} }
@ -123,13 +133,6 @@ function notify_real(msg, doc, no_hide, is_err) {
nb.innerHTML = msg; nb.innerHTML = msg;
if (notify_hide_timerid) {
window.clearTimeout(notify_hide_timerid);
}
notify_last_doc = doc;
notify_opacity = 1;
if (!no_hide) { if (!no_hide) {
notify_hide_timerid = window.setTimeout("hide_notify()", 3000); notify_hide_timerid = window.setTimeout("hide_notify()", 3000);
} }