summaryrefslogtreecommitdiff
path: root/plugins/newmail_notifier/newmail_notifier.js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-08-30 10:38:18 +0200
committerAleksander Machniak <alec@alec.pl>2013-08-30 10:38:18 +0200
commitc9e1e386e11edf8ba62876593d4643fd5022b10d (patch)
tree6362ccfd5940eda10f5111192a20003033f57462 /plugins/newmail_notifier/newmail_notifier.js
parentc1a0b072424568957eb686a049d8419e4d96c476 (diff)
Fix newmail_notifier issue where favicon wasn't changed back to default (#1489313)
Diffstat (limited to 'plugins/newmail_notifier/newmail_notifier.js')
-rw-r--r--plugins/newmail_notifier/newmail_notifier.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/newmail_notifier/newmail_notifier.js b/plugins/newmail_notifier/newmail_notifier.js
index 7c9b55ded..45238eb56 100644
--- a/plugins/newmail_notifier/newmail_notifier.js
+++ b/plugins/newmail_notifier/newmail_notifier.js
@@ -30,9 +30,9 @@ function newmail_notifier_run(prop)
function newmail_notifier_stop(prop)
{
// revert original favicon
- if (rcmail.env.favicon_href && (!prop || prop.action != 'check-recent')) {
+ if (rcmail.env.favicon_href && rcmail.env.favicon_changed && (!prop || prop.action != 'check-recent')) {
$('<link rel="shortcut icon" href="'+rcmail.env.favicon_href+'"/>').replaceAll('link[rel="shortcut icon"]');
- rcmail.env.favicon_href = null;
+ rcmail.env.favicon_changed = 0;
}
}
@@ -47,7 +47,10 @@ function newmail_notifier_basic()
var link = $('<link rel="shortcut icon" href="plugins/newmail_notifier/favicon.ico"/>'),
oldlink = $('link[rel="shortcut icon"]', w.document);
- rcmail.env.favicon_href = oldlink.attr('href');
+ if (!rcmail.env.favicon_href)
+ rcmail.env.favicon_href = oldlink.attr('href');
+
+ rcmail.env.favicon_changed = 1;
link.replaceAll(oldlink);
}