123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- if(!dojo._hasResource['dojox.widget.Dialog']){
- dojo._hasResource['dojox.widget.Dialog'] = true;
- dojo.provide('dojox.widget.Dialog');
- dojo.experimental('dojox.widget.Dialog');
- dojo.require("dojo.window");
- dojo.require('dojox.fx');
- dojo.require("dojox.widget.DialogSimple");
- dojo.declare('dojox.widget.Dialog', dojox.widget.DialogSimple,
- {
-
-
-
-
-
-
-
-
-
-
-
-
- templateString: dojo.cache("dojox.widget", "Dialog/Dialog.html", "<div class=\"dojoxDialog\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"${id}_title\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dojoxDialogTitleBar\">\n\t\t<span dojoAttachPoint=\"titleNode\" class=\"dojoxDialogTitle\" id=\"${id}_title\">${title}</span>\n\t</div>\n\t<div dojoAttachPoint=\"dojoxDialogWrapper\">\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dojoxDialogPaneContent\"></div>\n\t</div>\n\t<div dojoAttachPoint=\"closeButtonNode\" class=\"dojoxDialogCloseIcon\" dojoAttachEvent=\"onclick: onCancel\">\n\t\t\t<span dojoAttachPoint=\"closeText\" class=\"closeText\">x</span>\n\t</div>\n</div>\n"),
-
-
-
-
-
-
-
- sizeToViewport: false,
-
-
-
-
-
-
- viewportPadding: 35,
-
-
-
-
- dimensions: null,
-
-
-
- easing: null,
-
-
-
- sizeDuration: dijit._defaultDuration,
-
-
-
-
- sizeMethod: "chain",
-
-
-
- showTitle: false,
-
-
-
- draggable: false,
-
-
-
-
-
- modal: false,
-
- constructor: function(props, node){
- this.easing = props.easing || dojo._defaultEasing;
- this.dimensions = props.dimensions || [300, 300];
- },
-
- _setup: function(){
-
- this.inherited(arguments);
- if(!this._alreadyInitialized){
- this._navIn = dojo.fadeIn({ node: this.closeButtonNode });
- this._navOut = dojo.fadeOut({ node: this.closeButtonNode });
- if(!this.showTitle){
- dojo.addClass(this.domNode,"dojoxDialogNoTitle");
- }
- }
- },
-
- layout: function(e){
- this._setSize();
- this.inherited(arguments);
- },
-
- _setSize: function(){
-
- this._vp = dojo.window.getBox();
- var tc = this.containerNode,
- vpSized = this.sizeToViewport
- ;
- return this._displaysize = {
- w: vpSized ? tc.scrollWidth : this.dimensions[0],
- h: vpSized ? tc.scrollHeight : this.dimensions[1]
- };
- },
-
- show: function(){
- if(this.open){ return; }
-
- this._setSize();
- dojo.style(this.closeButtonNode,"opacity", 0);
- dojo.style(this.domNode, {
- overflow: "hidden",
- opacity: 0,
- width: "1px",
- height: "1px"
- });
- dojo.style(this.containerNode, {
- opacity: 0,
- overflow: "hidden"
- });
-
- this.inherited(arguments);
- if(this.modal){
-
-
-
- this._modalconnects.push(dojo.connect(dojo.body(), "onkeypress", function(e){
- if(e.charOrCode == dojo.keys.ESCAPE){
- dojo.stopEvent(e);
- }
- }));
- }else{
-
- this._modalconnects.push(dojo.connect(dijit._underlay.domNode, "onclick", this, "onCancel"));
- }
- this._modalconnects.push(dojo.connect(this.domNode,"onmouseenter",this,"_handleNav"));
- this._modalconnects.push(dojo.connect(this.domNode,"onmouseleave",this,"_handleNav"));
-
- },
-
- _handleNav: function(e){
-
- var navou = "_navOut",
- navin = "_navIn",
- animou = (e.type == "mouseout" ? navin : navou),
- animin = (e.type == "mouseout" ? navou : navin)
- ;
-
- this[animou].stop();
- this[animin].play();
-
- },
-
-
-
- _position: function(){
-
- if(!this._started){ return; }
-
- if(this._sizing){
- this._sizing.stop();
- this.disconnect(this._sizingConnect);
- delete this._sizing;
- }
-
- this.inherited(arguments);
-
- if(!this.open){ dojo.style(this.containerNode, "opacity", 0); }
- var pad = this.viewportPadding * 2;
-
- var props = {
- node: this.domNode,
- duration: this.sizeDuration || dijit._defaultDuration,
- easing: this.easing,
- method: this.sizeMethod
- };
- var ds = this._displaysize || this._setSize();
- props['width'] = ds.w = (ds.w + pad >= this._vp.w || this.sizeToViewport)
- ? this._vp.w - pad : ds.w;
-
- props['height'] = ds.h = (ds.h + pad >= this._vp.h || this.sizeToViewport)
- ? this._vp.h - pad : ds.h;
-
- this._sizing = dojox.fx.sizeTo(props);
- this._sizingConnect = this.connect(this._sizing,"onEnd","_showContent");
- this._sizing.play();
- },
- _showContent: function(e){
-
- var container = this.containerNode;
- dojo.style(this.domNode, {
- overflow: "visible",
- opacity: 1
- });
- dojo.style(this.closeButtonNode,"opacity",1);
- dojo.style(container, {
- height: this._displaysize.h - this.titleNode.offsetHeight + "px",
- width: this._displaysize.w + "px",
- overflow:"auto"
- });
- dojo.anim(container, { opacity:1 });
- }
-
- });
- }
|