roojs-all.js
authorAlan Knowles <alan@akbkhome.com>
Fri, 11 Feb 2011 05:09:46 +0000 (13:09 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 11 Feb 2011 05:09:46 +0000 (13:09 +0800)
roojs-all.js

index 76abebe..4eec8cd 100644 (file)
@@ -519,7 +519,7 @@ this.refreshSize();this.adjustAssets();this.focus();this.fireEvent("move",this,t
 D.call(this);return this;},isVisible:function(){return this.el.isVisible();},animHide:function(A){var b=Roo.get(this.animateTarget).getBox();this.proxy.show();this.proxy.setBounds(this.xy[0],this.xy[1],this.size.width,this.size.height);this.el.hide();this.proxy.setBounds(b.x,b.y,b.width,b.height,true,.35,this.hideEl.createDelegate(this,[A]));},hide:function(A){if(this.fireEvent("beforehide",this)===false){return;}if(this.shadow){this.shadow.hide();}if(this.shim){this.shim.hide();}if(this.animateTarget&&Roo.get(this.animateTarget)){this.animHide(A);}else {this.el.hide();this.hideEl(A);}return this;},hideEl:function(A){this.proxy.hide();if(this.modal){this.mask.hide();Roo.get(document.body).removeClass("x-body-masked");}
 this.fireEvent("hide",this);if(typeof A=="function"){A();}},hideAction:function(){this.setLeft("-10000px");this.setTop("-10000px");this.setStyle("visibility","hidden");},refreshSize:function(){this.size=this.el.getSize();this.xy=this.el.getXY();Roo.state.Manager.set(this.stateId||this.el.id+"-state",this.el.getBox());},setZIndex:function(A){if(this.modal){this.mask.setStyle("z-index",A);}if(this.shim){this.shim.setStyle("z-index",++A);}if(this.shadow){this.shadow.setZIndex(++A);}
 this.el.setStyle("z-index",++A);if(this.proxy){this.proxy.setStyle("z-index",++A);}if(this.resizer){this.resizer.proxy.setStyle("z-index",++A);}
-this.lastZIndex=A;},getEl:function(){return this.el;}});Roo.DialogManager=function(){var A={};var B=[];var C=null;var D=function(d1,d2){return (!d1._lastAccess||d1._lastAccess<d2._lastAccess)?-1:1;};var E=function(){B.sort(D);var F=Roo.DialogManager.zseed;for(var i=0,G=B.length;i<G;i++){var H=B[i];if(H){H.setZIndex(F+(i*10));}}};return {zseed:9000,register:function(F){A[F.id]=F;B.push(F);},unregister:function(F){delete A[F.id];var i=0;var G=0;if(!B.indexOf){for(i=0,G=B.length;i<G;i++){if(B[i]==F){B.splice(i,1);return;}}}else {i=B.indexOf(F);if(i!=-1){B.splice(i,1);}}},get:function(id){return typeof id=="object"?id:A[id];},bringToFront:function(F){F=this.get(F);if(F!=C){C=F;F._lastAccess=new Date().getTime();E();}return F;},sendToBack:function(F){F=this.get(F);F._lastAccess=-(new Date().getTime());E();return F;},hideAll:function(){for(var id in A){if(A[id]&&typeof A[id]!="function"&&A[id].isVisible()){A[id].hide();}}}};}();Roo.LayoutDialog=function(el,A){var B=A;if(typeof(A)=='undefined'){B=Roo.apply({},el);el=Roo.get(Roo.isIE?(document.body||document.documentElement):(document.documentElement||document.body)).createChild();}
+this.lastZIndex=A;},getEl:function(){return this.el;}});Roo.DialogManager=function(){var A={};var B=[];var C=null;var D=function(d1,d2){return (!d1._lastAccess||d1._lastAccess<d2._lastAccess)?-1:1;};var E=function(){B.sort(D);var F=Roo.DialogManager.zseed;for(var i=0,G=B.length;i<G;i++){var H=B[i];if(H){H.setZIndex(F+(i*10));}}};return {zseed:9000,register:function(F){A[F.id]=F;B.push(F);},unregister:function(F){delete A[F.id];var i=0;var G=0;if(!B.indexOf){for(i=0,G=B.length;i<G;i++){if(B[i]==F){B.splice(i,1);return;}}}else {i=B.indexOf(F);if(i!=-1){B.splice(i,1);}}},get:function(id){return typeof id=="object"?id:A[id];},bringToFront:function(F){F=this.get(F);if(F!=C){C=F;F._lastAccess=new Date().getTime();E();}return F;},sendToBack:function(F){F=this.get(F);F._lastAccess=-(new Date().getTime());E();return F;},hideAll:function(){for(var id in A){if(A[id]&&typeof A[id]!="function"&&A[id].isVisible()){A[id].hide();}}}};}();Roo.LayoutDialog=function(el,A){var B=A;if(typeof(A)=='undefined'){B=Roo.apply({},el);el=Roo.get(document.body||document.documentElement).createChild();}
 B.autoTabs=false;Roo.LayoutDialog.superclass.constructor.call(this,el,B);this.body.setStyle({overflow:"hidden",position:"relative"});this.layout=new Roo.BorderLayout(this.body.dom,B);this.layout.monitorWindowResize=false;this.el.addClass("x-dlg-auto-layout");this.center=Roo.BasicDialog.prototype.center;this.on("show",this.layout.layout,this.layout,true);if(B.items){var C=B.items;delete B.items;Roo.each(C,this.addxtype,this);}};Roo.extend(Roo.LayoutDialog,Roo.BasicDialog,{endUpdate:function(){this.layout.endUpdate();},beginUpdate:function(){this.layout.beginUpdate();},getLayout:function(){return this.layout;},showEl:function(){Roo.LayoutDialog.superclass.showEl.apply(this,arguments);if(Roo.isIE7){this.layout.layout();}},syncBodyHeight:function(){Roo.LayoutDialog.superclass.syncBodyHeight.call(this);if(this.layout){this.layout.layout();}},addxtype:function(c){return this.layout.addxtype(c);}});
 Roo.MessageBox=function(){var A,B,C,D;var E,F,G,H,I,pp;var J,K,L;var M=function(Q){A.hide();Roo.callback(B.fn,B.scope||window,[Q,K.dom.value],1);};var N=function(){if(B&&B.cls){A.el.removeClass(B.cls);}if(D){Roo.TaskMgr.stop(D);D=null;}};var O=function(b){var Q=0;if(!b){J["ok"].hide();J["cancel"].hide();J["yes"].hide();J["no"].hide();A.footer.dom.style.display='none';return Q;}
 A.footer.dom.style.display='';for(var k in J){if(typeof J[k]!="function"){if(b[k]){J[k].show();J[k].setText(typeof b[k]=="string"?b[k]:Roo.MessageBox.buttonText[k]);Q+=J[k].el.getWidth()+15;}else {J[k].hide();}}}return Q;};var P=function(d,k,e){if(B&&B.closable!==false){A.hide();}if(e){e.stopEvent();}};return {getDialog:function(){if(!A){A=new Roo.BasicDialog("x-msg-box",{autoCreate:true,shadow:true,draggable:true,resizable:false,constraintoviewport:false,fixedcenter:true,collapsible:false,shim:true,modal:true,width:400,height:100,buttonAlign:"center",closeClick:function(){if(B&&B.buttons&&B.buttons.no&&!B.buttons.cancel){M("no");}else {M("cancel");}}});A.on("hide",N);C=A.mask;A.addKeyListener(27,P);J={};var bt=this.buttonText;J["ok"]=A.addButton(bt["ok"],M.createCallback("ok"));J["yes"]=A.addButton(bt["yes"],M.createCallback("yes"));J["no"]=A.addButton(bt["no"],M.createCallback("no"));J["cancel"]=A.addButton(bt["cancel"],M.createCallback("cancel"));E=A.body.createChild({html:'<span class="roo-mb-text"></span><br /><input type="text" class="roo-mb-input" /><textarea class="roo-mb-textarea"></textarea><div class="roo-mb-progress-wrap"><div class="roo-mb-progress"><div class="roo-mb-progress-bar">&#160;</div></div></div>'});F=E.dom.firstChild;G=Roo.get(E.dom.childNodes[2]);G.enableDisplayMode();G.addKeyListener([10,13],function(){if(A.isVisible()&&B&&B.buttons){if(B.buttons.ok){M("ok");}else if(B.buttons.yes){M("yes");}}});H=Roo.get(E.dom.childNodes[3]);H.enableDisplayMode();I=Roo.get(E.dom.childNodes[4]);I.enableDisplayMode();var pf=I.dom.firstChild;if(pf){pp=Roo.get(pf.firstChild);pp.setHeight(pf.offsetHeight);}}return A;},updateText:function(Q){if(!A.isVisible()&&!B.width){A.resizeTo(this.maxWidth,100);}