mootools / mootools-core

MooTools Core Repository
https://mootools.net
2.65k stars 507 forks source link

Element.dispose() - Do not remove ID's #2690

Closed kije closed 9 years ago

kije commented 9 years ago

Element.dispose() removes a element from DOM and returns it. However, the id attribute of the returned Element(s) is removed. There should be at least a possibility (parameter) to make dispose() not remove the id attribute.

arian commented 9 years ago

dispose should not remove the ID attribute.

http://jsfiddle.net/4cm2h8rb/ shows that this indeed does not happen.

In which situation is the attribute removed for you?

DimitarChristoff commented 9 years ago

@arian probably el.clone().dispose() - though that's kind of pointless given that clone does not add a parentNode anyway.

https://github.com/mootools/mootools-core/blob/master/Source/Element/Element.js#L959

suggest close.

SergioCrisostomo commented 9 years ago

@kije please comment back if you can make a jsFiddle reproducing the problem you pointed out.