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.DropdownContainer");
12
dojo.require("dojo.widget.*");
13
dojo.require("dojo.widget.HtmlWidget");
14
dojo.require("dojo.widget.PopupContainer");
15
dojo.require("dojo.event.*");
16
dojo.require("dojo.html.layout");
17
dojo.require("dojo.html.display");
18
dojo.require("dojo.html.iframe");
19
dojo.require("dojo.html.util");
20
dojo.widget.defineWidget("dojo.widget.DropdownContainer", dojo.widget.HtmlWidget, {inputWidth:"7em", id:"", inputId:"", inputName:"", iconURL:dojo.uri.moduleUri("dojo.widget", "templates/images/combo_box_arrow.png"), copyClasses:false, iconAlt:"", containerToggle:"plain", containerToggleDuration:150, templateString:"<span style=\"white-space:nowrap\"><input type=\"hidden\" name=\"\" value=\"\" dojoAttachPoint=\"valueNode\" /><input name=\"\" type=\"text\" value=\"\" style=\"vertical-align:middle;\" dojoAttachPoint=\"inputNode\" autocomplete=\"off\" /> <img src=\"${this.iconURL}\" alt=\"${this.iconAlt}\" dojoAttachEvent=\"onclick:onIconClick\" dojoAttachPoint=\"buttonNode\" style=\"vertical-align:middle; cursor:pointer; cursor:hand\" /></span>", templateCssPath:"", isContainer:true, attachTemplateNodes:function () {
21
	dojo.widget.DropdownContainer.superclass.attachTemplateNodes.apply(this, arguments);
22
	this.popup = dojo.widget.createWidget("PopupContainer", {toggle:this.containerToggle, toggleDuration:this.containerToggleDuration});
23
	this.containerNode = this.popup.domNode;
24
}, fillInTemplate:function (args, frag) {
25
	this.domNode.appendChild(this.popup.domNode);
26
	if (this.id) {
27
		this.domNode.id = this.id;
28
	}
29
	if (this.inputId) {
30
		this.inputNode.id = this.inputId;
31
	}
32
	if (this.inputName) {
33
		this.inputNode.name = this.inputName;
34
	}
35
	this.inputNode.style.width = this.inputWidth;
36
	this.inputNode.disabled = this.disabled;
37
	if (this.copyClasses) {
38
		this.inputNode.style = "";
39
		this.inputNode.className = this.getFragNodeRef(frag).className;
40
	}
41
	dojo.event.connect(this.inputNode, "onchange", this, "onInputChange");
42
}, onIconClick:function (evt) {
43
	if (this.disabled) {
44
		return;
45
	}
46
	if (!this.popup.isShowingNow) {
47
		this.popup.open(this.inputNode, this, this.buttonNode);
48
	} else {
49
		this.popup.close();
50
	}
51
}, hideContainer:function () {
52
	if (this.popup.isShowingNow) {
53
		this.popup.close();
54
	}
55
}, onInputChange:function () {
56
}, enable:function () {
57
	this.inputNode.disabled = false;
58
	dojo.widget.DropdownContainer.superclass.enable.apply(this, arguments);
59
}, disable:function () {
60
	this.inputNode.disabled = true;
61
	dojo.widget.DropdownContainer.superclass.disable.apply(this, arguments);
62
}});
63