root / trunk / web / dojo / dijit / PopupMenuItem.js @ 10
History | View | Annotate | Download (1.16 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dijit.PopupMenuItem"]){ |
||
9 | dojo._hasResource["dijit.PopupMenuItem"]=true; |
||
10 | dojo.provide("dijit.PopupMenuItem");
|
||
11 | dojo.require("dijit.MenuItem");
|
||
12 | dojo.declare("dijit.PopupMenuItem",dijit.MenuItem,{_fillContent:function(){ |
||
13 | if(this.srcNodeRef){ |
||
14 | var _1=dojo.query("*",this.srcNodeRef); |
||
15 | dijit.PopupMenuItem.superclass._fillContent.call(this,_1[0]); |
||
16 | this.dropDownContainer=this.srcNodeRef; |
||
17 | } |
||
18 | },startup:function(){ |
||
19 | if(this._started){ |
||
20 | return;
|
||
21 | } |
||
22 | this.inherited(arguments); |
||
23 | if(!this.popup){ |
||
24 | var _2=dojo.query("[widgetId]",this.dropDownContainer)[0]; |
||
25 | this.popup=dijit.byNode(_2);
|
||
26 | } |
||
27 | dojo.body().appendChild(this.popup.domNode);
|
||
28 | this.popup.startup();
|
||
29 | this.popup.domNode.style.display="none"; |
||
30 | if(this.arrowWrapper){ |
||
31 | dojo.style(this.arrowWrapper,"visibility",""); |
||
32 | } |
||
33 | dijit.setWaiState(this.focusNode,"haspopup","true"); |
||
34 | },destroyDescendants:function(){ |
||
35 | if(this.popup){ |
||
36 | if(!this.popup._destroyed){ |
||
37 | this.popup.destroyRecursive();
|
||
38 | } |
||
39 | delete this.popup; |
||
40 | } |
||
41 | this.inherited(arguments); |
||
42 | }}); |
||
43 | } |