Added controller method to show/hide navigation.
This commit is contained in:
parent
64819b6eeb
commit
c86c99167d
4 changed files with 17 additions and 0 deletions
|
@ -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',
|
||||
|
|
|
@ -10,6 +10,8 @@ class Index extends App.ControllerContent
|
|||
@navigate '#'
|
||||
return
|
||||
|
||||
@navHide()
|
||||
|
||||
@title 'Sign in'
|
||||
@render()
|
||||
@navupdate '#login'
|
||||
|
|
|
@ -12,6 +12,8 @@ class Index extends App.ControllerContent
|
|||
@navigate '#'
|
||||
return
|
||||
|
||||
@navHide()
|
||||
|
||||
# set title
|
||||
@title 'Reset Password'
|
||||
@navupdate '#reset_password'
|
||||
|
|
|
@ -12,6 +12,8 @@ class Index extends App.ControllerContent
|
|||
@navigate '#'
|
||||
return
|
||||
|
||||
@navHide()
|
||||
|
||||
# set title
|
||||
@title 'Sign up'
|
||||
@navupdate '#signup'
|
||||
|
|
Loading…
Reference in a new issue