Use Element.remove() in $.rm when possible.

This commit is contained in:
Nicolas Stepien 2013-04-13 18:01:09 +02:00
parent 5b349905eb
commit 766be903b6
2 changed files with 7 additions and 4 deletions

View File

@ -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) ->

View File

@ -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) <% } %>->