Update $.rmAll according to a new benchmark.
This commit is contained in:
parent
06e5ce4ef6
commit
fdca68fe38
@ -102,10 +102,8 @@ $.hasClass = (el, className) ->
|
|||||||
$.rm = (el) ->
|
$.rm = (el) ->
|
||||||
el.remove()
|
el.remove()
|
||||||
$.rmAll = (root) ->
|
$.rmAll = (root) ->
|
||||||
# jsperf.com/emptify-element
|
# https://gist.github.com/MayhemYDG/8646194
|
||||||
for node in [root.childNodes...]
|
root.textContent = null
|
||||||
node.remove()
|
|
||||||
return
|
|
||||||
$.tn = (s) ->
|
$.tn = (s) ->
|
||||||
d.createTextNode s
|
d.createTextNode s
|
||||||
$.nodes = (nodes) ->
|
$.nodes = (nodes) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user