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