Added controller method to show/hide navigation.

This commit is contained in:
Martin Edenhofer 2014-07-20 23:50:03 +02:00
parent 64819b6eeb
commit c86c99167d
4 changed files with 17 additions and 0 deletions

View file

@ -95,6 +95,16 @@ class App.Controller extends Spine.Controller
navupdate: (url) ->
App.Event.trigger 'navupdate', url
# show navigation
navShow: ->
return if $('#navigation').is(':visible')
$('#navigation').attr('style', 'display: flex!important')
# hide navigation
navHide: ->
return if !$('#navigation').is(':visible')
$('#navigation').attr('style', 'display: none!important')
scrollTo: ( x = 0, y = 0, delay = 0 ) ->
a = ->
window.scrollTo( x, y )
@ -460,6 +470,7 @@ class App.ControllerContent extends App.Controller
super
$('.content').hide()
$('#content').show()
@navShow()
class App.ControllerModal extends App.Controller
className: 'modal fade',

View file

@ -10,6 +10,8 @@ class Index extends App.ControllerContent
@navigate '#'
return
@navHide()
@title 'Sign in'
@render()
@navupdate '#login'

View file

@ -12,6 +12,8 @@ class Index extends App.ControllerContent
@navigate '#'
return
@navHide()
# set title
@title 'Reset Password'
@navupdate '#reset_password'

View file

@ -12,6 +12,8 @@ class Index extends App.ControllerContent
@navigate '#'
return
@navHide()
# set title
@title 'Sign up'
@navupdate '#signup'