Move existence check into $.rm.
This commit is contained in:
parent
c5eb74ba5f
commit
5ffc7f4bd4
@ -105,7 +105,7 @@ Index =
|
||||
d.implementation.createDocument(null, null, null).appendChild board
|
||||
|
||||
$.rm el for el in $$ '.navLinks'
|
||||
$.id('search-box')?.parentNode.remove()
|
||||
$.rm $.id('search-box')?.parentNode
|
||||
topNavPos = $.id('delform').previousElementSibling
|
||||
$.before topNavPos, $.el 'hr'
|
||||
$.before topNavPos, Index.navLinks
|
||||
|
||||
@ -156,7 +156,7 @@ $.hasClass = (el, className) ->
|
||||
className in el.classList
|
||||
|
||||
$.rm = (el) ->
|
||||
el.remove()
|
||||
el?.remove()
|
||||
|
||||
$.rmAll = (root) ->
|
||||
# https://gist.github.com/MayhemYDG/8646194
|
||||
|
||||
@ -121,7 +121,7 @@ ImageExpand =
|
||||
|
||||
$.rmClass post.nodes.root, 'expanded-image'
|
||||
$.rmClass file.thumb, 'expanding'
|
||||
$.rm file.videoControls if file.videoControls
|
||||
$.rm file.videoControls
|
||||
file.thumb.parentNode.href = file.url
|
||||
file.thumb.parentNode.target = '_blank'
|
||||
for x in ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView']
|
||||
|
||||
@ -117,9 +117,9 @@ Captcha.noscript =
|
||||
|
||||
destroy: ->
|
||||
return unless @isEnabled
|
||||
$.rm @nodes.img if @nodes.img
|
||||
$.rm @nodes.img
|
||||
delete @nodes.img
|
||||
$.rm @nodes.iframe if @nodes.iframe
|
||||
$.rm @nodes.iframe
|
||||
delete @nodes.iframe
|
||||
delete @occupied
|
||||
@beforeSetup()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user