From: edward Date: Thu, 28 Jan 2016 09:07:44 +0000 (+0800) Subject: roojs-core.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=27647bffe53ce5d9377dddfbde63470ae9a50245 roojs-core.js roojs-core-debug.js --- diff --git a/roojs-core-debug.js b/roojs-core-debug.js index 05ee0018e7..bf06c205e1 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -8126,7 +8126,7 @@ if(opt.anim.isAnimated()){ return 0; } - if(this.pxReg.test(x)){ + if(new RegExp(this.pxReg).test(x)){ return parseFloat(x); } diff --git a/roojs-core.js b/roojs-core.js index b1d260d55a..711eae2ade 100644 --- a/roojs-core.js +++ b/roojs-core.js @@ -337,7 +337,7 @@ if(!h){h=parseInt(this.getStyle('height'),10)||0;if(!this.isBorderBox()){h+=this }else{this.anim({width:{to:J},height:{to:K}},this.preanim(arguments,2));}return this;},setBounds:function(x,y,J,K,L){if(!L||!A){this.setSize(J,K);this.setLocation(x,y);}else{J=this.adjustWidth(J);K=this.adjustHeight(K);this.anim({points:{to:[x,y]},width:{to:J},height:{to:K}},this.preanim(arguments,4),'motion'); }return this;},setRegion:function(J,K){this.setBounds(J.left,J.top,J.right-J.left,J.bottom-J.top,this.preanim(arguments,1));return this;},addListener:function(J,fn,K,L){if(this.dom){Roo.EventManager.on(this.dom,J,fn,K||this,L);}},removeListener:function(J,fn){Roo.EventManager.removeListener(this.dom,J,fn); return this;},removeAllListeners:function(){E.purgeElement(this.dom);return this;},relayEvent:function(J,K){this.on(J,function(e){K.fireEvent(J,e);});},setOpacity:function(J,K){if(!K||!A){var s=this.dom.style;if(Roo.isIE){s.zoom=1;s.filter=(s.filter||'').replace(/alpha\([^\)]*\)/gi,"")+(J==1?"":"alpha(opacity="+J*100+")"); -}else{s.opacity=J;}}else{this.anim({opacity:{to:J}},this.preanim(arguments,1),null,.35,'easeIn');}return this;},getLeft:function(J){if(!J){return this.getX();}else{var x=this.getStyle("left");if(!x||x==='AUTO'){return 0;}if(this.pxReg.test(x)){return parseFloat(x); +}else{s.opacity=J;}}else{this.anim({opacity:{to:J}},this.preanim(arguments,1),null,.35,'easeIn');}return this;},getLeft:function(J){if(!J){return this.getX();}else{var x=this.getStyle("left");if(!x||x==='AUTO'){return 0;}if(new RegExp(this.pxReg).test(x)){return parseFloat(x); }x=this.getX();var K=this.dom.offsetParent?Roo.fly(this.dom.offsetParent):false;if(K!==false){x-=K.getX();}return x;}},getRight:function(J){if(!J){return this.getX()+this.getWidth();}else{return (this.getLeft(true)+this.getWidth())||0;}},getTop:function(J){if(!J){return this.getY(); }else{return parseInt(this.getStyle("top"),10)||0;}},getBottom:function(J){if(!J){return this.getY()+this.getHeight();}else{return (this.getTop(true)+this.getHeight())||0;}},position:function(J,K,x,y){if(!J){if(this.getStyle('position')=='static'){this.setStyle('position','relative'); }}else{this.setStyle("position",J);}if(K){this.setStyle("z-index",K);}if(x!==undefined&&y!==undefined){this.setXY([x,y]);}else if(x!==undefined){this.setX(x);}else if(y!==undefined){this.setY(y);}},clearPositioning:function(J){J=J||'';this.setStyle({"left":J,"right":J,"top":J,"bottom":J,"z-index":"","position":"static"});