mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Minor code cleanup
This commit is contained in:
parent
e7a0101910
commit
e2ad2e5117
2 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -19,7 +19,7 @@ class app.views.Notice extends app.View
|
|||
|
||||
show: ->
|
||||
@html @tmpl("#{@type}Notice", @args...)
|
||||
@prependTo $('._app')
|
||||
@prependTo app.el
|
||||
return
|
||||
|
||||
hide: ->
|
||||
|
|
Loading…
Reference in a new issue