fabiomcosta / mootools-meio-autocomplete

A complete mootools Autocomplete plugin
http://www.meiocodigo.com/projects/meio-autocomplete/
32 stars 14 forks source link

Added missing destroy() to Meio.Element.List #26

Closed RiZKiT closed 11 years ago

RiZKiT commented 11 years ago

Using '.destroy()' on a Meio.Autocomplete instance results in:

TypeError: this.elements[element].destroy is not a function

in Meio.Widget.destroy(), because there is a destroy() function in Meio.Element.Field but not in Meio.Element.List.

This fixes it, only drawback is, that the list element will be destroyed, even if it's shared with different instances.

fabiomcosta commented 11 years ago

Cool! thx for pointing out the drawback! Maybe it should have "linkedCounter" that increases everytime its used and we check for it before destroying it.

RiZKiT commented 11 years ago

Feels like one of the fastest Pulls ever! ;-)

linkedCounter sounds promising, but i'm exhausted now. Took me a day to get autocomplete working in that special case we have this time: it's bound to an input which will be replaced after a Request.HTML. Sounds simpler then was...

fabiomcosta commented 11 years ago

:) thx for the contribution!