| dojo.provide("dojo.widget.HtmlWidget"); |
| dojo.require("dojo.widget.DomWidget"); |
| dojo.require("dojo.html.util"); |
| dojo.require("dojo.html.display"); |
| dojo.require("dojo.html.layout"); |
| dojo.require("dojo.lang.extras"); |
| dojo.require("dojo.lang.func"); |
| dojo.require("dojo.lfx.toggle"); |
| dojo.declare("dojo.widget.HtmlWidget",dojo.widget.DomWidget,{templateCssPath:null,templatePath:null,lang:"",toggle:"plain",toggleDuration:150,initialize:function(_1,_2){ |
| },postMixInProperties:function(_3,_4){ |
| if(this.lang===""){ |
| this.lang=null; |
| } |
| this.toggleObj=dojo.lfx.toggle[this.toggle.toLowerCase()]||dojo.lfx.toggle.plain; |
| },createNodesFromText:function(_5,_6){ |
| return dojo.html.createNodesFromText(_5,_6); |
| },destroyRendering:function(_7){ |
| try{ |
| if(this.bgIframe){ |
| this.bgIframe.remove(); |
| delete this.bgIframe; |
| } |
| if(!_7&&this.domNode){ |
| dojo.event.browser.clean(this.domNode); |
| } |
| dojo.widget.HtmlWidget.superclass.destroyRendering.call(this); |
| } |
| catch(e){ |
| } |
| },isShowing:function(){ |
| return dojo.html.isShowing(this.domNode); |
| },toggleShowing:function(){ |
| if(this.isShowing()){ |
| this.hide(); |
| }else{ |
| this.show(); |
| } |
| },show:function(){ |
| if(this.isShowing()){ |
| return; |
| } |
| this.animationInProgress=true; |
| this.toggleObj.show(this.domNode,this.toggleDuration,null,dojo.lang.hitch(this,this.onShow),this.explodeSrc); |
| },onShow:function(){ |
| this.animationInProgress=false; |
| this.checkSize(); |
| },hide:function(){ |
| if(!this.isShowing()){ |
| return; |
| } |
| this.animationInProgress=true; |
| this.toggleObj.hide(this.domNode,this.toggleDuration,null,dojo.lang.hitch(this,this.onHide),this.explodeSrc); |
| },onHide:function(){ |
| this.animationInProgress=false; |
| },_isResized:function(w,h){ |
| if(!this.isShowing()){ |
| return false; |
| } |
| var wh=dojo.html.getMarginBox(this.domNode); |
| var _b=w||wh.width; |
| var _c=h||wh.height; |
| if(this.width==_b&&this.height==_c){ |
| return false; |
| } |
| this.width=_b; |
| this.height=_c; |
| return true; |
| },checkSize:function(){ |
| if(!this._isResized()){ |
| return; |
| } |
| this.onResized(); |
| },resizeTo:function(w,h){ |
| dojo.html.setMarginBox(this.domNode,{width:w,height:h}); |
| if(this.isShowing()){ |
| this.onResized(); |
| } |
| },resizeSoon:function(){ |
| if(this.isShowing()){ |
| dojo.lang.setTimeout(this,this.onResized,0); |
| } |
| },onResized:function(){ |
| dojo.lang.forEach(this.children,function(_f){ |
| if(_f.checkSize){ |
| _f.checkSize(); |
| } |
| }); |
| }}); |