New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when trying to delete DOM elements #1492

Closed
brukhabtu opened this Issue Apr 20, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@brukhabtu

brukhabtu commented Apr 20, 2011

I have some elements I am adding and deleting and I occasionally get this error. The library I am using is not my own and can be found http://code.google.com/p/django-dynamic-formset/ .

Uncaught TypeError: Cannot set property 'vmouseover' of undefined
teardownbrukhabtu.com/js/jquery.mobile-1.0a4.1.js:867
jQuery.event.removecode.jquery.com/jquery-1.5.2.js:2385
jQuery.event.removecode.jquery.com/jquery-1.5.2.js:2352
jQuery.extend.cleanDatacode.jquery.com/jquery-1.5.2.js:5697
$.cleanDatabrukhabtu.com/js/jquery.mobile-1.0a4.1.js:27
jQuery.fn.extend.removecode.jquery.com/jquery-1.5.2.js:5190
$.fn.formset.insertDeleteLinkbrukhabtu.com/js/jquery.formset.js:62
jQuery.event.handlecode.jquery.com/jquery-1.5.2.js:2568
jQuery.event.add.elemData.handle.eventHandlecode.jquery.com/jquery-1.5.2.js:2207

I have found a fix for this but since I know nearly nothing about jquery mobile's inner workings it may break things more. Here is the fix.

Replace
bindings[eventType] = false; // line 867

with:
if (bindings != undefined) {bindings[eventType] = false;}

If someone who understands the code a bit more can assure me that this doesn't break anything in the long run i will request for a pull.

@jblas

This comment has been minimized.

Show comment
Hide comment
@jblas

jblas Apr 20, 2011

Contributor

Hi @brukhabtu,

We could certainly check an undefined bindings data value. I just want to confirm with some folks in the know if stripping of element data before teardown is called, is expected behavior. It seems like stripping of data should happen AFTER just in case the special event needed something in the data to aid with cleanup.

Contributor

jblas commented Apr 20, 2011

Hi @brukhabtu,

We could certainly check an undefined bindings data value. I just want to confirm with some folks in the know if stripping of element data before teardown is called, is expected behavior. It seems like stripping of data should happen AFTER just in case the special event needed something in the data to aid with cleanup.

@ghost ghost assigned jblas Apr 20, 2011

@jblas

This comment has been minimized.

Show comment
Hide comment
@jblas

jblas Apr 21, 2011

Contributor

@brukhabtu

I landed your fix with some additional comments and gave you credit.

d4c7b5d

Thanks for finding, filing, and fixing. :-)

  • Kin
Contributor

jblas commented Apr 21, 2011

@brukhabtu

I landed your fix with some additional comments and gave you credit.

d4c7b5d

Thanks for finding, filing, and fixing. :-)

  • Kin

@jblas jblas closed this Apr 21, 2011

@brukhabtu

This comment has been minimized.

Show comment
Hide comment
@brukhabtu

brukhabtu Apr 21, 2011

Thanks, glad to be of some help.

brukhabtu commented Apr 21, 2011

Thanks, glad to be of some help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment