ResizableTextarea_wev8.js
2.75 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
Copyright (c) 2004-2005, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.widget.ResizableTextarea");
dojo.require("dojo.html");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.LayoutPane");
dojo.require("dojo.widget.ResizeHandle");
dojo.widget.tags.addParseTreeHandler("dojo:resizabletextarea");
dojo.widget.ResizableTextarea = function(){
dojo.widget.HtmlWidget.call(this);
}
dojo.inherits(dojo.widget.ResizableTextarea, dojo.widget.HtmlWidget);
dojo.lang.extend(dojo.widget.ResizableTextarea, {
templatePath: dojo.uri.dojoUri("src/widget/templates/HtmlResizableTextarea.html"),
templateCssPath: dojo.uri.dojoUri("src/widget/templates/HtmlResizableTextarea_wev8.css"),
widgetType: "ResizableTextarea",
tagName: "dojo:resizabletextarea",
isContainer: false,
textAreaNode: null,
textAreaContainer: null,
textAreaContainerNode: null,
statusBar: null,
statusBarContainerNode: null,
statusLabelNode: null,
statusLabel: null,
rootLayoutNode: null,
resizeHandleNode: null,
resizeHandle: null,
fillInTemplate: function(args, frag){
this.textAreaNode = this.getFragNodeRef(frag).cloneNode(true);
// FIXME: Safari apparently needs this!
document.body.appendChild(this.domNode);
this.rootLayout = dojo.widget.fromScript(
"LayoutPane",
{
minHeight: 50,
minWidth: 100
},
this.rootLayoutNode
);
this.textAreaContainer = dojo.widget.fromScript(
"LayoutPane",
{ layoutAlign: "client" },
this.textAreaContainerNode
);
this.rootLayout.addPane(this.textAreaContainer);
this.textAreaContainer.domNode.appendChild(this.textAreaNode);
with(this.textAreaNode.style){
width="100%";
height="100%";
}
this.statusBar = dojo.widget.fromScript(
"LayoutPane",
{
layoutAlign: "bottom",
minHeight: 28
},
this.statusBarContainerNode
);
this.rootLayout.addPane(this.statusBar);
this.statusLabel = dojo.widget.fromScript(
"LayoutPane",
{
layoutAlign: "client",
minWidth: 50
},
this.statusLabelNode
);
this.statusBar.addPane(this.statusLabel);
this.resizeHandle = dojo.widget.fromScript(
"ResizeHandle",
{ targetElmId: this.rootLayout.widgetId },
this.resizeHandleNode
);
this.statusBar.addPane(this.resizeHandle);
// dojo.debug(this.rootLayout.widgetId);
// dojo.event.connect(this.resizeHandle, "beginSizing", this, "hideContent");
// dojo.event.connect(this.resizeHandle, "endSizing", this, "showContent");
},
hideContent: function(){
this.textAreaNode.style.display = "none";
},
showContent: function(){
this.textAreaNode.style.display = "";
}
});