mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 16:05:49 +01:00
fix titles on ajaxify
This commit is contained in:
@@ -358,7 +358,7 @@ var socket,
|
|||||||
titleObj.interval = setInterval(function() {
|
titleObj.interval = setInterval(function() {
|
||||||
var title = titleObj.titles[titleObj.titles.indexOf(window.document.title) ^ 1];
|
var title = titleObj.titles[titleObj.titles.indexOf(window.document.title) ^ 1];
|
||||||
if (title) {
|
if (title) {
|
||||||
window.document.title = title;
|
window.document.title = $('<div/>').html(title).text();
|
||||||
}
|
}
|
||||||
}, 2000);
|
}, 2000);
|
||||||
});
|
});
|
||||||
@@ -367,7 +367,7 @@ var socket,
|
|||||||
clearInterval(titleObj.interval);
|
clearInterval(titleObj.interval);
|
||||||
}
|
}
|
||||||
if (titleObj.titles[0]) {
|
if (titleObj.titles[0]) {
|
||||||
window.document.title = titleObj.titles[0];
|
window.document.title = $('<div/>').html(titleObj.titles[0]).text();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -380,6 +380,9 @@ var socket,
|
|||||||
}
|
}
|
||||||
|
|
||||||
socket.emit('meta.buildTitle', url, function(err, title, numNotifications) {
|
socket.emit('meta.buildTitle', url, function(err, title, numNotifications) {
|
||||||
|
if (err) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
titleObj.titles[0] = (numNotifications > 0 ? '(' + numNotifications + ') ' : '') + title;
|
titleObj.titles[0] = (numNotifications > 0 ? '(' + numNotifications + ') ' : '') + title;
|
||||||
app.alternatingTitle('');
|
app.alternatingTitle('');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user