devdocs/assets/javascripts/app/settings.coffee
2013-10-24 20:49:33 +02:00

25 lines
408 B
CoffeeScript

class app.Settings
hasDocs: ->
try
!!Cookies.get 'docs'
catch
getDocs: ->
try
Cookies.get('docs')?.split('/') or app.config.default_docs
catch
app.config.default_docs
setDocs: (docs) ->
try
Cookies.set 'docs', docs.join('/'),
path: '/'
expires: 1e8
catch
return
reset: ->
try
Cookies.expire 'docs'
catch
return