Add notifications in title
This commit is contained in:
parent
e34b8e6d46
commit
318bc23e8a
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -71,3 +71,15 @@
|
||||||
<ul id="nav-notifications-template" style="display:none;" rel="template">
|
<ul id="nav-notifications-template" style="display:none;" rel="template">
|
||||||
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
|
<li class="{4}"><a href="{0}"><img src="{1}" height="24" width="24" alt="" />{2} <span class="notif-when">{3}</span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<script>
|
||||||
|
var pagetitle = null;
|
||||||
|
$("nav").bind('nav-update', function(e,data){
|
||||||
|
if (pagetitle==null) pagetitle = document.title;
|
||||||
|
var count = $(data).find('notif').attr('count');
|
||||||
|
if (count>0) {
|
||||||
|
document.title = "("+count+") "+pagetitle;
|
||||||
|
} else {
|
||||||
|
document.title = pagetitle;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user