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