wip
This commit is contained in:
parent
c05abf4da7
commit
3a39a36bed
22 changed files with 136 additions and 100 deletions
|
|
@ -28,18 +28,18 @@
|
|||
document.title = 'Misskey'
|
||||
this.Progress.start();
|
||||
this.stream.on 'post' this.on-stream-post
|
||||
document.addEventListener 'visibilitychange' @window-on-visibilitychange, false
|
||||
document.addEventListener 'visibilitychange' @window-onVisibilitychange, false
|
||||
|
||||
this.on('unmount', () => {
|
||||
this.stream.off 'post' this.on-stream-post
|
||||
document.removeEventListener 'visibilitychange' @window-on-visibilitychange
|
||||
document.removeEventListener 'visibilitychange' @window-onVisibilitychange
|
||||
|
||||
this.on-stream-post = (post) => {
|
||||
if document.hidden and post.user_id !== this.I.id
|
||||
@unread-count++
|
||||
document.title = '(' + @unread-count + ') ' + @get-post-summary post
|
||||
|
||||
this.window-on-visibilitychange = () => {
|
||||
this.window-onVisibilitychange = () => {
|
||||
if !document.hidden
|
||||
this.unread-count = 0
|
||||
document.title = 'Misskey'
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
this.mode = 'default'
|
||||
|
||||
this.on('mount', () => {
|
||||
document.addEventListener 'visibilitychange' @window-on-visibilitychange, false
|
||||
document.addEventListener 'visibilitychange' @window-onVisibilitychange, false
|
||||
document.addEventListener 'keydown' this.on-document-keydown
|
||||
window.addEventListener 'scroll' this.on-scroll
|
||||
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
this.trigger('loaded');
|
||||
|
||||
this.on('unmount', () => {
|
||||
document.removeEventListener 'visibilitychange' @window-on-visibilitychange
|
||||
document.removeEventListener 'visibilitychange' @window-onVisibilitychange
|
||||
document.removeEventListener 'keydown' this.on-document-keydown
|
||||
window.removeEventListener 'scroll' this.on-scroll
|
||||
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
@unread-count++
|
||||
document.title = '(' + @unread-count + ') ' + @get-post-summary post
|
||||
|
||||
this.window-on-visibilitychange = () => {
|
||||
this.window-onVisibilitychange = () => {
|
||||
if !document.hidden
|
||||
this.unread-count = 0
|
||||
document.title = 'Misskey'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue