Minor code cleanup

This commit is contained in:
Thibaut Courouble 2017-08-07 17:08:05 -04:00
parent e7a0101910
commit e2ad2e5117
2 changed files with 8 additions and 3 deletions

View file

@ -10,17 +10,21 @@ class app.views.Path extends app.View
after: 'afterRoute'
render: (args...) ->
@show()
@html @tmpl 'path', args...
@show()
return
show: ->
$.prepend $('._app'), @el unless @el.parentNode
@prependTo app.el unless @el.parentNode
return
hide: ->
$.remove @el if @el.parentNode
return
onClick: (event) =>
@clicked = true if link = $.closestLink event.target, @el
return
afterRoute: (route, context) =>
if context.type
@ -36,3 +40,4 @@ class app.views.Path extends app.View
if @clicked
@clicked = null
app.document.sidebar.reset()
return

View file

@ -19,7 +19,7 @@ class app.views.Notice extends app.View
show: ->
@html @tmpl("#{@type}Notice", @args...)
@prependTo $('._app')
@prependTo app.el
return
hide: ->