Minor code cleanup

pull/647/merge
Thibaut Courouble 8 years ago
parent e7a0101910
commit e2ad2e5117

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

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

Loading…
Cancel
Save