sridhars711 / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

when the dyntree is "undisplayed" (ie. the DIV removed from DOM or sth. similiar), focus throws an error $(this.span).find is not a function #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a dyntree
2. do something
3. remove the DIV with the dyntree in it
4. profit :) ... an error is thrown in the JS console

This is fixable by replacing lines 261ff with:

    focus: function() {
//      logMsg("dtnode.focus(): %o", this);
        this.makeVisible();
        try{
        jQuery(this.span).find(">a").focus();}
        catch(x){};
    },

BTW: I took the freadom to also rewrite "$" to jQuery, as in
jQuery.noconflict() $ may or may not be a shortcut to jQuery

Would be happy if this fix gets applied,

Harald

Original issue reported on code.google.com by haraldar...@gmail.com on 16 Oct 2008 at 12:46

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 17 Oct 2008 at 6:00

GoogleCodeExporter commented 9 years ago
Applied with r61
Wasn't able to reproduce the described exception using $('#tree').remove(), 
still the
try - catch won't hurt.
Renaming $ to jQuery is now issue #43

Original comment by moo...@wwwendt.de on 19 Oct 2008 at 9:34

GoogleCodeExporter commented 9 years ago
behaviour was exposed when using dyntree within a tiny_mce editor window, that 
was
cleared up. (that is, not only $('#tree').remove(), but <iframe><html><body><div
id='content'><div id='tree'>.... 

and all starting with the iframe removed.

rather exotic, but not unusual :) guess problem starts with the jQuery object 
being
connected to the iframe-window-object and race condition occuring.

Harald

Original comment by haraldar...@gmail.com on 20 Oct 2008 at 5:23

GoogleCodeExporter commented 9 years ago
considered verified

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:12