Subversion Repositories Applications.papyrus

Rev

Rev 1318 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
1422 alexandre_ 11
 
12
 
1318 alexandre_ 13
dojo.provide("dojo.widget.TreeLinkExtension");
14
dojo.require("dojo.widget.HtmlWidget");
15
dojo.require("dojo.widget.TreeExtension");
16
dojo.widget.defineWidget("dojo.widget.TreeLinkExtension", dojo.widget.TreeExtension, function () {
17
	this.params = {};
18
}, {listenTreeEvents:["afterChangeTree"], listenTree:function (tree) {
19
	dojo.widget.TreeCommon.prototype.listenTree.call(this, tree);
20
	var labelNode = tree.labelNodeTemplate;
21
	var newLabel = this.makeALabel();
22
	dojo.html.setClass(newLabel, dojo.html.getClass(labelNode));
23
	labelNode.parentNode.replaceChild(newLabel, labelNode);
24
}, makeALabel:function () {
25
	var newLabel = document.createElement("a");
26
	for (var key in this.params) {
27
		if (key in {}) {
28
			continue;
29
		}
30
		newLabel.setAttribute(key, this.params[key]);
31
	}
32
	return newLabel;
33
}, onAfterChangeTree:function (message) {
34
	var _this = this;
35
	if (!message.oldTree) {
36
		this.listenNode(message.node);
37
	}
38
}, listenNode:function (node) {
39
	for (var key in node.object) {
40
		if (key in {}) {
41
			continue;
42
		}
43
		node.labelNode.setAttribute(key, node.object[key]);
44
	}
45
}});
46