X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/src/resizer/ResizeTracker.js diff --git a/src/resizer/ResizeTracker.js b/src/resizer/ResizeTracker.js index 360f6461..8a7a376b 100644 --- a/src/resizer/ResizeTracker.js +++ b/src/resizer/ResizeTracker.js @@ -25,6 +25,8 @@ Ext.define('Ext.resizer.ResizeTracker', { // Default to no constraint constrainTo: null, + + proxyCls: Ext.baseCSSPrefix + 'resizable-proxy', constructor: function(config) { var me = this; @@ -81,15 +83,45 @@ Ext.define('Ext.resizer.ResizeTracker', { * If dynamic is false, this will be a proxy, otherwise it will be our actual target. */ getDynamicTarget: function() { - var d = this.target; - if (this.dynamic) { - return d; - } else if (!this.proxy) { - this.proxy = d.isComponent ? d.getProxy().addCls(Ext.baseCSSPrefix + 'resizable-proxy') : d.createProxy({tag: 'div', cls: Ext.baseCSSPrefix + 'resizable-proxy', id: d.id + '-rzproxy'}, Ext.getBody()); - this.proxy.removeCls(Ext.baseCSSPrefix + 'proxy-el'); + var me = this, + target = me.target; + + if (me.dynamic) { + return target; + } else if (!me.proxy) { + me.proxy = me.createProxy(target); + } + me.proxy.show(); + return me.proxy; + }, + + /** + * Create a proxy for this resizer + * @param {Ext.Component/Ext.Element} target The target + * @return {Ext.Element} A proxy element + */ + createProxy: function(target){ + var proxy, + cls = this.proxyCls, + renderTo; + + if (target.isComponent) { + proxy = target.getProxy().addCls(cls); + } else { + renderTo = Ext.getBody(); + if (Ext.scopeResetCSS) { + renderTo = Ext.getBody().createChild({ + cls: Ext.baseCSSPrefix + 'reset' + }); + } + proxy = target.createProxy({ + tag: 'div', + cls: cls, + id: target.id + '-rzproxy' + }, renderTo); } - this.proxy.show(); - return this.proxy; + proxy.removeCls(Ext.baseCSSPrefix + 'proxy-el'); + return proxy; }, onStart: function(e) {