root / trunk / web / dojo / dijit / DialogUnderlay.js @ 9
History | View | Annotate | Download (1.38 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.DialogUnderlay"]){ |
||
9 | dojo._hasResource["dijit.DialogUnderlay"]=true; |
||
10 | dojo.provide("dijit.DialogUnderlay");
|
||
11 | dojo.require("dojo.window");
|
||
12 | dojo.require("dijit._Widget");
|
||
13 | dojo.require("dijit._Templated");
|
||
14 | dojo.declare("dijit.DialogUnderlay",[dijit._Widget,dijit._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(id){ |
||
15 | dojo.attr(this.node,"id",id+"_underlay"); |
||
16 | },_setClassAttr:function(_1){ |
||
17 | this.node.className="dijitDialogUnderlay "+_1; |
||
18 | },postCreate:function(){ |
||
19 | dojo.body().appendChild(this.domNode);
|
||
20 | },layout:function(){ |
||
21 | var is=this.node.style,os=this.domNode.style; |
||
22 | os.display="none";
|
||
23 | var _2=dojo.window.getBox();
|
||
24 | os.top=_2.t+"px";
|
||
25 | os.left=_2.l+"px";
|
||
26 | is.width=_2.w+"px";
|
||
27 | is.height=_2.h+"px";
|
||
28 | os.display="block";
|
||
29 | },show:function(){ |
||
30 | this.domNode.style.display="block"; |
||
31 | this.layout();
|
||
32 | this.bgIframe=new dijit.BackgroundIframe(this.domNode); |
||
33 | },hide:function(){ |
||
34 | this.bgIframe.destroy();
|
||
35 | this.domNode.style.display="none"; |
||
36 | },uninitialize:function(){ |
||
37 | if(this.bgIframe){ |
||
38 | this.bgIframe.destroy();
|
||
39 | } |
||
40 | this.inherited(arguments); |
||
41 | }}); |
||
42 | } |