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.js

44 lines
777 B

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