mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
update title to show number of unread items
This commit is contained in:
parent
d7b91b1de1
commit
745ade6121
@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>YARR</title>
|
||||
<title>yarr!</title>
|
||||
<link rel="stylesheet" href="./static/stylesheets/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="./static/stylesheets/app.css">
|
||||
<link rel="icon shortcut" href="./static/images/anchor.png">
|
||||
|
@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var TITLE = document.title
|
||||
|
||||
DOMPurify.addHook('afterSanitizeAttributes', function (node) {
|
||||
// set all elements owning target to target=_blank
|
||||
if ('target' in node) {
|
||||
@ -186,6 +188,16 @@ var vm = new Vue({
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'feedStats': {
|
||||
deep: true,
|
||||
handler: debounce(function() {
|
||||
var title = TITLE
|
||||
if (this.totalStats.unread) {
|
||||
title += ' ('+this.totalStats.unread+')'
|
||||
}
|
||||
document.title = title
|
||||
}, 500),
|
||||
},
|
||||
'filterSelected': function(newVal, oldVal) {
|
||||
if (oldVal === null) return // do nothing, initial setup
|
||||
api.settings.update({filter: newVal}).then(this.refreshItems.bind(this))
|
||||
|
Loading…
x
Reference in New Issue
Block a user