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) ->
|
navupdate: (url) ->
|
||||||
App.Event.trigger '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 ) ->
|
scrollTo: ( x = 0, y = 0, delay = 0 ) ->
|
||||||
a = ->
|
a = ->
|
||||||
window.scrollTo( x, y )
|
window.scrollTo( x, y )
|
||||||
|
@ -460,6 +470,7 @@ class App.ControllerContent extends App.Controller
|
||||||
super
|
super
|
||||||
$('.content').hide()
|
$('.content').hide()
|
||||||
$('#content').show()
|
$('#content').show()
|
||||||
|
@navShow()
|
||||||
|
|
||||||
class App.ControllerModal extends App.Controller
|
class App.ControllerModal extends App.Controller
|
||||||
className: 'modal fade',
|
className: 'modal fade',
|
||||||
|
|
|
@ -10,6 +10,8 @@ class Index extends App.ControllerContent
|
||||||
@navigate '#'
|
@navigate '#'
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@navHide()
|
||||||
|
|
||||||
@title 'Sign in'
|
@title 'Sign in'
|
||||||
@render()
|
@render()
|
||||||
@navupdate '#login'
|
@navupdate '#login'
|
||||||
|
|
|
@ -12,6 +12,8 @@ class Index extends App.ControllerContent
|
||||||
@navigate '#'
|
@navigate '#'
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@navHide()
|
||||||
|
|
||||||
# set title
|
# set title
|
||||||
@title 'Reset Password'
|
@title 'Reset Password'
|
||||||
@navupdate '#reset_password'
|
@navupdate '#reset_password'
|
||||||
|
|
|
@ -12,6 +12,8 @@ class Index extends App.ControllerContent
|
||||||
@navigate '#'
|
@navigate '#'
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@navHide()
|
||||||
|
|
||||||
# set title
|
# set title
|
||||||
@title 'Sign up'
|
@title 'Sign up'
|
||||||
@navupdate '#signup'
|
@navupdate '#signup'
|
||||||
|
|
Loading…
Reference in a new issue