Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1372 Rev 1422
1
/*
1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
3
	All Rights Reserved.
4
 
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
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:
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
9
*/
-
 
10
 
-
 
11
 
10
 
12
 
11
dojo.provide("dojo.widget.TitlePane");
13
dojo.provide("dojo.widget.TitlePane");
12
dojo.require("dojo.widget.*");
14
dojo.require("dojo.widget.*");
13
dojo.require("dojo.widget.ContentPane");
15
dojo.require("dojo.widget.ContentPane");
14
dojo.require("dojo.html.style");
16
dojo.require("dojo.html.style");
15
dojo.require("dojo.lfx.*");
17
dojo.require("dojo.lfx.*");
16
dojo.widget.defineWidget("dojo.widget.TitlePane", dojo.widget.ContentPane, {labelNodeClass:"", containerNodeClass:"", label:"", open:true, templateString:"<div dojoAttachPoint=\"domNode\">\n<div dojoAttachPoint=\"labelNode\" dojoAttachEvent=\"onclick: onLabelClick\"></div>\n<div dojoAttachPoint=\"containerNode\"></div>\n</div>\n", postCreate:function () {
18
dojo.widget.defineWidget("dojo.widget.TitlePane", dojo.widget.ContentPane, {labelNodeClass:"", containerNodeClass:"", label:"", open:true, templateString:"<div dojoAttachPoint=\"domNode\">\n<div dojoAttachPoint=\"labelNode\" dojoAttachEvent=\"onclick: onLabelClick\"></div>\n<div dojoAttachPoint=\"containerNode\"></div>\n</div>\n", postCreate:function () {
17
	if (this.label) {
19
	if (this.label) {
18
		this.labelNode.appendChild(document.createTextNode(this.label));
20
		this.labelNode.appendChild(document.createTextNode(this.label));
19
	}
21
	}
20
	if (this.labelNodeClass) {
22
	if (this.labelNodeClass) {
21
		dojo.html.addClass(this.labelNode, this.labelNodeClass);
23
		dojo.html.addClass(this.labelNode, this.labelNodeClass);
22
	}
24
	}
23
	if (this.containerNodeClass) {
25
	if (this.containerNodeClass) {
24
		dojo.html.addClass(this.containerNode, this.containerNodeClass);
26
		dojo.html.addClass(this.containerNode, this.containerNodeClass);
25
	}
27
	}
26
	if (!this.open) {
28
	if (!this.open) {
27
		dojo.html.hide(this.containerNode);
29
		dojo.html.hide(this.containerNode);
28
	}
30
	}
29
	dojo.widget.TitlePane.superclass.postCreate.apply(this, arguments);
31
	dojo.widget.TitlePane.superclass.postCreate.apply(this, arguments);
30
}, onLabelClick:function () {
32
}, onLabelClick:function () {
31
	if (this.open) {
33
	if (this.open) {
32
		dojo.lfx.wipeOut(this.containerNode, 250).play();
34
		dojo.lfx.wipeOut(this.containerNode, 250).play();
33
		this.open = false;
35
		this.open = false;
34
	} else {
36
	} else {
35
		dojo.lfx.wipeIn(this.containerNode, 250).play();
37
		dojo.lfx.wipeIn(this.containerNode, 250).play();
36
		this.open = true;
38
		this.open = true;
37
	}
39
	}
38
}, setLabel:function (label) {
40
}, setLabel:function (label) {
39
	this.labelNode.innerHTML = label;
41
	this.labelNode.innerHTML = label;
40
}});
42
}});
41
 
43