Use Element.remove() in $.rm when possible.
This commit is contained in:
parent
5b349905eb
commit
766be903b6
@ -97,8 +97,11 @@ $.extend $,
|
||||
el.classList.remove className
|
||||
hasClass: (el, className) ->
|
||||
el.classList.contains className
|
||||
rm: (el) ->
|
||||
el.parentNode.removeChild el
|
||||
rm: do ->
|
||||
if 'remove' of Element.prototype
|
||||
(el) -> el.remove()
|
||||
else
|
||||
(el) -> el.parentNode?.removeChild el
|
||||
tn: (s) ->
|
||||
d.createTextNode s
|
||||
nodes: (nodes) ->
|
||||
|
||||
@ -225,7 +225,7 @@ class Notification
|
||||
setTimeout @close, @timeout * $.SECOND if @timeout
|
||||
|
||||
close = ->
|
||||
$.rm @el if @el.parentNode
|
||||
$.rm @el
|
||||
|
||||
Settings =
|
||||
init: ->
|
||||
@ -3798,7 +3798,7 @@ Unread =
|
||||
{root} = post.nodes
|
||||
if root isnt $ '.thread > .replyContainer', root.parentNode # not the first reply
|
||||
$.before root, Unread.hr
|
||||
else if Unread.hr.parentNode
|
||||
else
|
||||
$.rm Unread.hr
|
||||
|
||||
update: <% if (type === 'crx') { %>(dontrepeat) <% } %>->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user