X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..HEAD:/examples/ux/layout/Center.js diff --git a/examples/ux/layout/Center.js b/examples/ux/layout/Center.js index 3f826e50..e904fc5c 100644 --- a/examples/ux/layout/Center.js +++ b/examples/ux/layout/Center.js @@ -52,11 +52,11 @@ var p = Ext.create('Ext.Panel', { Ext.define('Ext.ux.layout.Center', { extend: 'Ext.layout.container.Fit', alias: 'layout.ux.center', - // private - setItemSize : function(item, width, height){ + // private + setItemSize : function(item, width, height) { this.owner.addCls('ux-layout-center'); item.addCls('ux-layout-center-item'); - if(item && height > 0) { + if (height > 0) { if (width) { width = item.width; if (Ext.isNumber(item.widthRatio)) { @@ -64,6 +64,7 @@ Ext.define('Ext.ux.layout.Center', { } } item.setSize(width, height); + item.margins.left = Math.round((this.owner.el.getWidth() - width) * 0.5); } }