My favorites
▼
|
Sign in
dynatree
Dynatree is a JavaScript dynamic tree view plugin for jQuery with support for persistence, keyboard, checkboxes, drag'n'drop, and lazy loading.
Project Home
Downloads
Export to GitHub
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
269
attachment: jquery.dynatree.js.diff
(1.1 KB)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Index: jquery.dynatree.js
===================================================================
--- jquery.dynatree.js (revision 585)
+++ jquery.dynatree.js (working copy)
@@ -2451,6 +2451,13 @@
this.$lis = $("li:has(a[href])", this.element);
this.$tabs = this.$lis.map(function() { return $("a", this)[0]; });
*/
+ var treeConfig = {};
+ var treeConfigJSON = $ulParent.attr("data-dynatree");
+ if ( treeConfigJSON !== undefined ) {
+ treeConfig = $.parseJSON(treeConfigJSON);
+ }
+ var nodeDataAttrName = treeConfig.nodeDataAttrName || 'data';
+
$ulParent.find(">li").each(function() {
var $li = $(this),
$liSpan = $li.find(">span:first"),
@@ -2502,8 +2509,8 @@
data.key = $li.attr("id");
}
// If a data attribute is present, evaluate as a JavaScript object
- if( $li.attr("data") ) {
- var dataAttr = $.trim($li.attr("data"));
+ if( $li.attr(nodeDataAttrName) ) {
+ var dataAttr = $.trim($li.attr(nodeDataAttrName));
if( dataAttr ) {
if( dataAttr.charAt(0) != "{" ){
dataAttr = "{" + dataAttr + "}";
Powered by
Google Project Hosting