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">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<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/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="./static/stylesheets/app.css">
|
<link rel="stylesheet" href="./static/stylesheets/app.css">
|
||||||
<link rel="icon shortcut" href="./static/images/anchor.png">
|
<link rel="icon shortcut" href="./static/images/anchor.png">
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var TITLE = document.title
|
||||||
|
|
||||||
DOMPurify.addHook('afterSanitizeAttributes', function (node) {
|
DOMPurify.addHook('afterSanitizeAttributes', function (node) {
|
||||||
// set all elements owning target to target=_blank
|
// set all elements owning target to target=_blank
|
||||||
if ('target' in node) {
|
if ('target' in node) {
|
||||||
@ -186,6 +188,16 @@ var vm = new Vue({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
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) {
|
'filterSelected': function(newVal, oldVal) {
|
||||||
if (oldVal === null) return // do nothing, initial setup
|
if (oldVal === null) return // do nothing, initial setup
|
||||||
api.settings.update({filter: newVal}).then(this.refreshItems.bind(this))
|
api.settings.update({filter: newVal}).then(this.refreshItems.bind(this))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user