don't let notifications interfere with document titles

pull/1/head
ansuz 9 years ago
parent a9e2ca8d72
commit f29e3d7b0d

@ -33,7 +33,7 @@ define([
var notify = function () { var notify = function () {
if (!(Visible.isSupported() && !Visible.currently())) { return; } if (!(Visible.isSupported() && !Visible.currently())) { return; }
unnotify(); unnotify();
module.tabNotification = Notify.tab(document.title, 1000, 10); module.tabNotification = Notify.tab(1000, 10);
}; };
var setEditable = function (bool) { var setEditable = function (bool) {

@ -503,7 +503,7 @@ define([
var notify = module.notify = function () { var notify = module.notify = function () {
if (Visible.isSupported() && !Visible.currently()) { if (Visible.isSupported() && !Visible.currently()) {
unnotify(); unnotify();
module.tabNotification = Notify.tab(document.title, 1000, 10); module.tabNotification = Notify.tab(1000, 10);
} }
}; };

@ -41,8 +41,7 @@
} }
}; };
var tab = Module.tab = function (msg, frequency, count) { var tab = Module.tab = function (frequency, count) {
var original = document.title;
var key = '_pendingTabNotification'; var key = '_pendingTabNotification';
var favicon = document.getElementById('favicon'); var favicon = document.getElementById('favicon');
@ -56,7 +55,6 @@
// only run one tab notification at a time // only run one tab notification at a time
if (Module[key]) { if (Module[key]) {
window.clearInterval(Module[key]); window.clearInterval(Module[key]);
document.title = original;
if (favicon) { if (favicon) {
favicon.setAttribute('href', pending? alt : main); favicon.setAttribute('href', pending? alt : main);
} }
@ -69,11 +67,9 @@
cancel(); cancel();
var step = function () { var step = function () {
document.title = (document.title === original) ? msg : original;
if (favicon) { if (favicon) {
favicon.setAttribute('href', favicon.getAttribute('href') === main? alt : main); favicon.setAttribute('href', favicon.getAttribute('href') === main? alt : main);
} }
--count; --count;
}; };
@ -86,8 +82,6 @@
return { return {
cancel: cancel, cancel: cancel,
original: original
}; };
}; };

@ -389,7 +389,7 @@ define([
var notify = function () { var notify = function () {
if (Visible.isSupported() && !Visible.currently()) { if (Visible.isSupported() && !Visible.currently()) {
unnotify(); unnotify();
module.tabNotification = Notify.tab(document.title, 1000, 10); module.tabNotification = Notify.tab(1000, 10);
} }
}; };

@ -430,7 +430,7 @@ define([
var notify = function () { var notify = function () {
if (!(Visible.isSupported() && !Visible.currently())) { return; } if (!(Visible.isSupported() && !Visible.currently())) { return; }
unnotify(); unnotify();
module.tabNotification = Notify.tab(document.title, 1000, 10); module.tabNotification = Notify.tab(1000, 10);
}; };
// don't make changes until the interface is ready // don't make changes until the interface is ready
@ -725,6 +725,7 @@ define([
return; return;
} }
document.title = title; document.title = title;
module.tabNotification.update(title);
var proxy = module.rt.proxy; var proxy = module.rt.proxy;
if (proxy.metadata) { if (proxy.metadata) {
proxy.metadata.title = title; proxy.metadata.title = title;

@ -65,7 +65,7 @@ define([
var notify = function () { var notify = function () {
if (!(Visible.isSupported() && !Visible.currently())) { return; } if (!(Visible.isSupported() && !Visible.currently())) { return; }
unnotify(); unnotify();
APP.tabNofification = Notify.tab(document.title, 1000, 10); APP.tabNofification = Notify.tab(1000, 10);
}; };
var $modal = $('#modal'); var $modal = $('#modal');

Loading…
Cancel
Save