no message
This commit is contained in:
parent
98c5078027
commit
c26d588bff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "DooTask",
|
||||
"version": "0.2.47",
|
||||
"version": "0.2.49",
|
||||
"description": "DooTask is task management system.",
|
||||
"scripts": {
|
||||
"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>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'PageTitle',
|
||||
props: {
|
||||
@ -22,6 +24,23 @@ export default {
|
||||
this.updateTitle()
|
||||
},
|
||||
|
||||
|
||||
computed: {
|
||||
...mapState([
|
||||
'userId',
|
||||
'dialogs',
|
||||
]),
|
||||
|
||||
|
||||
msgAllUnread() {
|
||||
let num = 0;
|
||||
this.dialogs.map(({unread}) => {
|
||||
num += unread;
|
||||
})
|
||||
return num;
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
title: {
|
||||
handler() {
|
||||
@ -49,20 +68,10 @@ export default {
|
||||
},
|
||||
|
||||
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)
|
||||
if (this.userId && this.msgAllUnread > 0) {
|
||||
title+= " (" + this.msgAllUnread + ")"
|
||||
}
|
||||
document.title = title;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -440,32 +440,13 @@ export default {
|
||||
this.titleInterval = setInterval(() => {
|
||||
let {title} = document;
|
||||
let newTitle = title.replace(/^(.*?)\((\d+)\)$/g, "$1")
|
||||
if (this.userId) {
|
||||
if (this.msgAllUnread > 0) {
|
||||
if (this.userId && this.msgAllUnread > 0) {
|
||||
newTitle+= " (" + this.msgAllUnread + ")"
|
||||
}
|
||||
}
|
||||
if (title != newTitle) {
|
||||
this.setPageTile(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)
|
||||
document.title = newTitle;
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
notificationInit() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user