Sochettra / dynatree

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

Context Menu example has issue with jQuery 1.6.1 #203

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. replace 'jquery.min.js' with latest version (1.6.1)
2. run: http://wwwendt.de/tech/dynatree/doc/sample-contextmenu.html
3. open Context menu on any node, it shows undefined (node)

Dynatree is great!
Thanks.

Original issue reported on code.google.com by mrdu...@gmail.com on 31 May 2011 at 6:18

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
btw, I'm using: dynatree-1.1.1, jQuery v1.5.1 and it works.
but not working with jQuery 1.6.1

Original comment by mrdu...@gmail.com on 31 May 2011 at 6:23

GoogleCodeExporter commented 8 years ago
I investigated more & found out this line doesn't work with jQuery 1.6
var node = el.parents("[dtnode]").attr("dtnode");

It seems can't get dtnode attribute from <li> tag (parent of <span> tag). But 
it works fine with jQuery 1.5. Any idea?

Original comment by mrdu...@gmail.com on 31 May 2011 at 8:29

GoogleCodeExporter commented 8 years ago
May be related to this:
  http://api.jquery.com/prop/

Does 
  el.parents("[dtnode]")
not return a match, or will
  .attr("dtnode")
not work?
In the latter case, could you try .prop() instead?

Original comment by moo...@wwwendt.de on 31 May 2011 at 9:54

GoogleCodeExporter commented 8 years ago
It was the later case.
.prop() works! you are genius :)

API quoted - "Before jQuery 1.6, the .attr() method sometimes took property 
values into account when retrieving some attributes, which could cause 
inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to 
explicitly retrieve property values, while .attr() only retrieves attributes."

Can you add .prop() to support jQuery 1.6, I don't know if we can check jQuery 
version or not.

Original comment by mrdu...@gmail.com on 31 May 2011 at 4:44

GoogleCodeExporter commented 8 years ago
Fixed with r496

Original comment by moo...@wwwendt.de on 5 Jun 2011 at 5:09

GoogleCodeExporter commented 8 years ago
Release 1.1.2 is rather a feature release 1.2.0

Original comment by moo...@wwwendt.de on 6 Jun 2011 at 5:34

GoogleCodeExporter commented 8 years ago
Using $.ui.dynatree.getNode() may be an even better option (issue 213)

Original comment by moo...@wwwendt.de on 3 Jul 2011 at 12:49

GoogleCodeExporter commented 8 years ago
considered verified

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

GoogleCodeExporter commented 8 years ago

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