Small improvements.

This commit is contained in:
Martin Edenhofer 2012-04-11 09:18:51 +02:00
parent 446794f0bd
commit 9df585ee37
2 changed files with 8 additions and 16 deletions

View file

@ -1,10 +1,4 @@
$ = 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
events:
@ -63,13 +57,16 @@ class Index extends App.Controller
Spine.trigger 'navrebuild', data.session
# rebuild navbar with updated ticket count of overviews
Spine.trigger 'navupdate_remote'
# add notify
Spine.trigger 'notify:removeall'
Spine.trigger 'notify', {
type: 'success',
msg: 'Login successfully! Have a nice day!',
}
# redirect to #
if window.Config['requested_url'] isnt ''
@navigate window.Config['requested_url']
@ -96,8 +93,3 @@ class Index extends App.Controller
)
Config.Routes['login'] = Index
#class App.Login extends App.Router
# routes:
# 'login': Index
#Config.Controller.push App.Login

View file

@ -15,14 +15,14 @@ class App.Navigation extends Spine.Controller
Spine.bind 'navrebuild', (user) =>
@log 'navbarrebuild', user
@render(user)
@delay( @sync, 1600 )
Spine.bind 'navupdate_remote', (user) =>
@log 'navupdate_remote'
@sync
@delay( @sync, 500 )
# rerender if new overview data is there
@delay( @sync, 1600 )
@delay( @sync, 800 )
@delay( @sync, 2000 )
render: (user) ->
# @log 'nav render', Config.NavBar
@ -121,7 +121,7 @@ class App.Navigation extends Spine.Controller
clearInterval(@intervalID) if @intervalID
# request new data
@intervalID = every 40000, () =>
@intervalID = every 30000, () =>
@ticket_overview()
# get data