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.TreeDisableWrapExtension");
|
|
|
14 |
dojo.require("dojo.widget.HtmlWidget");
|
|
|
15 |
dojo.require("dojo.widget.TreeExtension");
|
|
|
16 |
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) {
|
|
|
17 |
var wrappingDiv = document.createElement("div");
|
|
|
18 |
var clazz = tree.classPrefix + "DisableWrap";
|
|
|
19 |
if (dojo.render.html.ie) {
|
|
|
20 |
clazz = clazz + " " + tree.classPrefix + "IEDisableWrap";
|
|
|
21 |
}
|
|
|
22 |
dojo.html.setClass(wrappingDiv, clazz);
|
|
|
23 |
var table = document.createElement("table");
|
|
|
24 |
wrappingDiv.appendChild(table);
|
|
|
25 |
var tbody = document.createElement("tbody");
|
|
|
26 |
table.appendChild(tbody);
|
|
|
27 |
var tr = document.createElement("tr");
|
|
|
28 |
tbody.appendChild(tr);
|
|
|
29 |
var td = document.createElement("td");
|
|
|
30 |
tr.appendChild(td);
|
|
|
31 |
if (tree.domNode.parentNode) {
|
|
|
32 |
tree.domNode.parentNode.replaceChild(wrappingDiv, tree.domNode);
|
|
|
33 |
}
|
|
|
34 |
td.appendChild(tree.domNode);
|
|
|
35 |
tree.domNode = wrappingDiv;
|
|
|
36 |
}});
|
|
|
37 |
|