You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/assets/javascripts/views/content/root_page.coffee

35 lines
725 B

class app.views.RootPage extends app.View
@events:
click: 'onClick'
init: ->
@setHidden false unless @isHidden() # reserve space in local storage
@render()
return
render: ->
@empty()
@append @tmpl('mobileNav') if app.isMobile()
@append @tmpl if @isHidden() then 'splash' else if app.isMobile() then 'mobileIntro' else 'intro'
return
hideIntro: ->
@setHidden true
@render()
return
setHidden: (value) ->
app.settings.set 'hideIntro', value
return
isHidden: ->
app.isSingleDoc() or app.settings.get 'hideIntro'
onRoute: ->
onClick: (event) =>
if event.target.hasAttribute 'data-hide-intro'
$.stopEvent(event)
@hideIntro()
return