don't let notifications interfere with document titles

This commit is contained in:
ansuz 2016-09-21 14:34:56 +02:00
parent a9e2ca8d72
commit f29e3d7b0d
6 changed files with 7 additions and 12 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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