Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | 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
 
11
dojo.provide("dojo.widget.TreeDisableWrapExtension");
12
dojo.require("dojo.widget.HtmlWidget");
13
dojo.require("dojo.widget.TreeExtension");
14
dojo.widget.defineWidget("dojo.widget.TreeDisableWrapExtension", dojo.widget.TreeExtension, {templateCssString:"\n/* CSS for TreeDisableWrapExtension */\n\n.TreeDisableWrap {\n\twhite-space: nowrap;\n}\n.TreeIEDisableWrap {\n\twidth: expression( 5 + firstChild.offsetWidth );\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TreeDisableWrap.css"), listenTree:function (tree) {
15
	var wrappingDiv = document.createElement("div");
16
	var clazz = tree.classPrefix + "DisableWrap";
17
	if (dojo.render.html.ie) {
18
		clazz = clazz + " " + tree.classPrefix + "IEDisableWrap";
19
	}
20
	dojo.html.setClass(wrappingDiv, clazz);
21
	var table = document.createElement("table");
22
	wrappingDiv.appendChild(table);
23
	var tbody = document.createElement("tbody");
24
	table.appendChild(tbody);
25
	var tr = document.createElement("tr");
26
	tbody.appendChild(tr);
27
	var td = document.createElement("td");
28
	tr.appendChild(td);
29
	if (tree.domNode.parentNode) {
30
		tree.domNode.parentNode.replaceChild(wrappingDiv, tree.domNode);
31
	}
32
	td.appendChild(tree.domNode);
33
	tree.domNode = wrappingDiv;
34
}});
35