Fixed taskbar notification.
This commit is contained in:
parent
25a500f5d1
commit
dd4652b515
1 changed files with 9 additions and 4 deletions
|
@ -117,19 +117,22 @@ class _Singleton extends App.Controller
|
||||||
if task.key isnt key
|
if task.key isnt key
|
||||||
if task.active
|
if task.active
|
||||||
task.active = false
|
task.active = false
|
||||||
console.log(111, 'save')
|
|
||||||
task.save()
|
task.save()
|
||||||
else
|
else
|
||||||
|
changed = false
|
||||||
if !task.active
|
if !task.active
|
||||||
console.log(222, 'save')
|
changed = true
|
||||||
task.active = true
|
task.active = true
|
||||||
|
if task.notify
|
||||||
|
changed = true
|
||||||
|
task.notify = false
|
||||||
|
if changed
|
||||||
task.save()
|
task.save()
|
||||||
else
|
else
|
||||||
for task in tasks
|
for task in tasks
|
||||||
if @activeTask isnt task.key
|
if @activeTask isnt task.key
|
||||||
if task.active
|
if task.active
|
||||||
task.active = false
|
task.active = false
|
||||||
console.log(333, 'save')
|
|
||||||
task.save()
|
task.save()
|
||||||
|
|
||||||
# start worker for task if not exists
|
# start worker for task if not exists
|
||||||
|
@ -176,7 +179,7 @@ class _Singleton extends App.Controller
|
||||||
return a
|
return a
|
||||||
|
|
||||||
get: ( key ) =>
|
get: ( key ) =>
|
||||||
tasks = App.Taskbar.all()
|
tasks = @all()
|
||||||
for task in tasks
|
for task in tasks
|
||||||
return task if task.key is key
|
return task if task.key is key
|
||||||
return
|
return
|
||||||
|
@ -207,6 +210,8 @@ class _Singleton extends App.Controller
|
||||||
if !task
|
if !task
|
||||||
throw "No such task with '#{key}' to notify"
|
throw "No such task with '#{key}' to notify"
|
||||||
task.notify = true
|
task.notify = true
|
||||||
|
task.save()
|
||||||
|
App.Event.trigger 'ui:rerender'
|
||||||
|
|
||||||
reset: =>
|
reset: =>
|
||||||
App.Taskbar.deleteAll()
|
App.Taskbar.deleteAll()
|
||||||
|
|
Loading…
Reference in a new issue