diff --git a/client/dcwebui.js b/client/dcwebui.js index 1e723c6..d0317c3 100644 --- a/client/dcwebui.js +++ b/client/dcwebui.js @@ -450,7 +450,13 @@ var tab_set = function(tab) { var tabitems = $(".tabitem"); for (var i in tabitems) { try { - tabitems[i].className = "tabitem" + (tabitems[i].getAttribute('data-tab') === tab ? ' selected' : ''); + // Update UNREAD/SELECTED flags for the target + var was_unread = (tabitems[i].className.indexOf("unread") !== -1); + var is_target = (tabitems[i].getAttribute('data-tab') === tab); + + var is_still_unread = (was_unread && !is_target); + + tabitems[i].className = "tabitem" + (is_target ? ' selected' : '') + (is_still_unread ? ' unread' : ''); } catch (e) {}; }