Small improvements.
This commit is contained in:
parent
446794f0bd
commit
9df585ee37
2 changed files with 8 additions and 16 deletions
|
@ -1,10 +1,4 @@
|
||||||
$ = jQuery.sub()
|
$ = jQuery.sub()
|
||||||
Note = App.Note
|
|
||||||
|
|
||||||
$.fn.item = ->
|
|
||||||
elementID = $(@).data('id')
|
|
||||||
elementID or= $(@).parents('[data-id]').data('id')
|
|
||||||
Note.find(elementID)
|
|
||||||
|
|
||||||
class Index extends App.Controller
|
class Index extends App.Controller
|
||||||
events:
|
events:
|
||||||
|
@ -63,6 +57,9 @@ class Index extends App.Controller
|
||||||
|
|
||||||
Spine.trigger 'navrebuild', data.session
|
Spine.trigger 'navrebuild', data.session
|
||||||
|
|
||||||
|
# rebuild navbar with updated ticket count of overviews
|
||||||
|
Spine.trigger 'navupdate_remote'
|
||||||
|
|
||||||
# add notify
|
# add notify
|
||||||
Spine.trigger 'notify:removeall'
|
Spine.trigger 'notify:removeall'
|
||||||
Spine.trigger 'notify', {
|
Spine.trigger 'notify', {
|
||||||
|
@ -96,8 +93,3 @@ class Index extends App.Controller
|
||||||
)
|
)
|
||||||
|
|
||||||
Config.Routes['login'] = Index
|
Config.Routes['login'] = Index
|
||||||
|
|
||||||
#class App.Login extends App.Router
|
|
||||||
# routes:
|
|
||||||
# 'login': Index
|
|
||||||
#Config.Controller.push App.Login
|
|
|
@ -15,14 +15,14 @@ class App.Navigation extends Spine.Controller
|
||||||
Spine.bind 'navrebuild', (user) =>
|
Spine.bind 'navrebuild', (user) =>
|
||||||
@log 'navbarrebuild', user
|
@log 'navbarrebuild', user
|
||||||
@render(user)
|
@render(user)
|
||||||
@delay( @sync, 1600 )
|
|
||||||
|
|
||||||
Spine.bind 'navupdate_remote', (user) =>
|
Spine.bind 'navupdate_remote', (user) =>
|
||||||
@log 'navupdate_remote'
|
@log 'navupdate_remote'
|
||||||
@sync
|
@delay( @sync, 500 )
|
||||||
|
|
||||||
# rerender if new overview data is there
|
# rerender if new overview data is there
|
||||||
@delay( @sync, 1600 )
|
@delay( @sync, 800 )
|
||||||
|
@delay( @sync, 2000 )
|
||||||
|
|
||||||
render: (user) ->
|
render: (user) ->
|
||||||
# @log 'nav render', Config.NavBar
|
# @log 'nav render', Config.NavBar
|
||||||
|
@ -121,7 +121,7 @@ class App.Navigation extends Spine.Controller
|
||||||
clearInterval(@intervalID) if @intervalID
|
clearInterval(@intervalID) if @intervalID
|
||||||
|
|
||||||
# request new data
|
# request new data
|
||||||
@intervalID = every 40000, () =>
|
@intervalID = every 30000, () =>
|
||||||
@ticket_overview()
|
@ticket_overview()
|
||||||
|
|
||||||
# get data
|
# get data
|
||||||
|
|
Loading…
Reference in a new issue