no message
This commit is contained in:
parent
98c5078027
commit
c26d588bff
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DooTask",
|
"name": "DooTask",
|
||||||
"version": "0.2.47",
|
"version": "0.2.49",
|
||||||
"description": "DooTask is task management system.",
|
"description": "DooTask is task management system.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm run development",
|
"dev": "npm run development",
|
||||||
|
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -3,6 +3,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {mapState} from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PageTitle',
|
name: 'PageTitle',
|
||||||
props: {
|
props: {
|
||||||
@ -22,6 +24,23 @@ export default {
|
|||||||
this.updateTitle()
|
this.updateTitle()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
...mapState([
|
||||||
|
'userId',
|
||||||
|
'dialogs',
|
||||||
|
]),
|
||||||
|
|
||||||
|
|
||||||
|
msgAllUnread() {
|
||||||
|
let num = 0;
|
||||||
|
this.dialogs.map(({unread}) => {
|
||||||
|
num += unread;
|
||||||
|
})
|
||||||
|
return num;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
title: {
|
title: {
|
||||||
handler() {
|
handler() {
|
||||||
@ -49,20 +68,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setPageTile(title) {
|
setPageTile(title) {
|
||||||
document.title = title;
|
if (this.userId && this.msgAllUnread > 0) {
|
||||||
let mobile = navigator.userAgent.toLowerCase();
|
title+= " (" + this.msgAllUnread + ")"
|
||||||
if (/iphone|ipad|ipod/.test(mobile)) {
|
|
||||||
let iframe = document.createElement('iframe');
|
|
||||||
iframe.style.display = 'none';
|
|
||||||
let iframeCallback = function () {
|
|
||||||
setTimeout(function () {
|
|
||||||
iframe.removeEventListener('load', iframeCallback);
|
|
||||||
document.body.removeChild(iframe)
|
|
||||||
}, 0)
|
|
||||||
};
|
|
||||||
iframe.addEventListener('load', iframeCallback);
|
|
||||||
document.body.appendChild(iframe)
|
|
||||||
}
|
}
|
||||||
|
document.title = title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -440,32 +440,13 @@ export default {
|
|||||||
this.titleInterval = setInterval(() => {
|
this.titleInterval = setInterval(() => {
|
||||||
let {title} = document;
|
let {title} = document;
|
||||||
let newTitle = title.replace(/^(.*?)\((\d+)\)$/g, "$1")
|
let newTitle = title.replace(/^(.*?)\((\d+)\)$/g, "$1")
|
||||||
if (this.userId) {
|
if (this.userId && this.msgAllUnread > 0) {
|
||||||
if (this.msgAllUnread > 0) {
|
|
||||||
newTitle+= " (" + this.msgAllUnread + ")"
|
newTitle+= " (" + this.msgAllUnread + ")"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (title != newTitle) {
|
if (title != newTitle) {
|
||||||
this.setPageTile(newTitle);
|
document.title = newTitle;
|
||||||
}
|
|
||||||
}, 500)
|
|
||||||
},
|
|
||||||
|
|
||||||
setPageTile(title) {
|
|
||||||
document.title = title;
|
|
||||||
let mobile = navigator.userAgent.toLowerCase();
|
|
||||||
if (/iphone|ipad|ipod/.test(mobile)) {
|
|
||||||
let iframe = document.createElement('iframe');
|
|
||||||
iframe.style.display = 'none';
|
|
||||||
let iframeCallback = function () {
|
|
||||||
setTimeout(function () {
|
|
||||||
iframe.removeEventListener('load', iframeCallback);
|
|
||||||
document.body.removeChild(iframe)
|
|
||||||
}, 0)
|
|
||||||
};
|
|
||||||
iframe.addEventListener('load', iframeCallback);
|
|
||||||
document.body.appendChild(iframe)
|
|
||||||
}
|
}
|
||||||
|
}, 1000)
|
||||||
},
|
},
|
||||||
|
|
||||||
notificationInit() {
|
notificationInit() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user