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.TitlePane");
14
dojo.require("dojo.widget.*");
15
dojo.require("dojo.widget.ContentPane");
16
dojo.require("dojo.html.style");
17
dojo.require("dojo.lfx.*");
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 () {
19
	if (this.label) {
20
		this.labelNode.appendChild(document.createTextNode(this.label));
21
	}
22
	if (this.labelNodeClass) {
23
		dojo.html.addClass(this.labelNode, this.labelNodeClass);
24
	}
25
	if (this.containerNodeClass) {
26
		dojo.html.addClass(this.containerNode, this.containerNodeClass);
27
	}
28
	if (!this.open) {
29
		dojo.html.hide(this.containerNode);
30
	}
31
	dojo.widget.TitlePane.superclass.postCreate.apply(this, arguments);
32
}, onLabelClick:function () {
33
	if (this.open) {
34
		dojo.lfx.wipeOut(this.containerNode, 250).play();
35
		this.open = false;
36
	} else {
37
		dojo.lfx.wipeIn(this.containerNode, 250).play();
38
		this.open = true;
39
	}
40
}, setLabel:function (label) {
41
	this.labelNode.innerHTML = label;
42
}});
43