X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/530ef4b6c5b943cfa68b779d11cf7de29aa878bf..6b044c28b5f26fb99c86c237ffad19741c0f7f3d:/docs/source/Element.style.html?ds=inline diff --git a/docs/source/Element.style.html b/docs/source/Element.style.html index 18fae4bc..23dc3b82 100644 --- a/docs/source/Element.style.html +++ b/docs/source/Element.style.html @@ -7,26 +7,25 @@
/*! - * Ext JS Library 3.2.1 - * Copyright(c) 2006-2010 Ext JS, Inc. - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ -/** +/** * @class Ext.Element */ Ext.Element.addMethods(function(){ // local style camelizing for speed - var propCache = {}, + var supports = Ext.supports, + propCache = {}, camelRe = /(-[a-z])/gi, - classReCache = {}, view = document.defaultView, - propFloat = Ext.isIE ? 'styleFloat' : 'cssFloat', opacityRe = /alpha\(opacity=(.*)\)/i, trimRe = /^\s+|\s+$/g, + EL = Ext.Element, spacesRe = /\s+/, wordsRe = /\w/g, - EL = Ext.Element, PADDING = "padding", MARGIN = "margin", BORDER = "border", @@ -55,7 +54,7 @@ Ext.Element.addMethods(function(){ } function chkCache(prop) { - return propCache[prop] || (propCache[prop] = prop == 'float' ? propFloat : prop.replace(camelRe, camelFn)); + return propCache[prop] || (propCache[prop] = prop == 'float' ? (supports.cssFloat ? 'cssFloat' : 'styleFloat') : prop.replace(camelRe, camelFn)); } return { @@ -207,29 +206,26 @@ Ext.Element.addMethods(function(){ v, cs, out, - display, - wk = Ext.isWebKit, display; if(el == document){ return null; } prop = chkCache(prop); - // Fix bug caused by this: https://bugs.webkit.org/show_bug.cgi?id=13343 - if(wk && /marginRight/.test(prop)){ - display = this.getStyle('display'); - el.style.display = 'inline-block'; - } out = (v = el.style[prop]) ? v : (cs = view.getComputedStyle(el, "")) ? cs[prop] : null; - - // Webkit returns rgb values for transparent. - if(wk){ - if(out == 'rgba(0, 0, 0, 0)'){ - out = 'transparent'; - }else if(display){ - el.style.display = display; - } + + // Ignore cases when the margin is correctly reported as 0, the bug only shows + // numbers larger. + if(prop == 'marginRight' && out != '0px' && !supports.correctRightMargin){ + display = el.style.display; + el.style.display = 'inline-block'; + out = view.getComputedStyle(el, '').marginRight; + el.style.display = display; + } + + if(prop == 'backgroundColor' && out == 'rgba(0, 0, 0, 0)' && !supports.correctTransparentColor){ + out = 'transparent'; } return out; } : @@ -268,7 +264,7 @@ Ext.Element.addMethods(function(){ color = (typeof prefix != 'undefined') ? prefix : '#', h; - if(!v || /transparent|inherit/.test(v)){ + if(!v || (/transparent|inherit/.test(v))) { return defaultValue; } if(/^r/.test(v)){ @@ -290,9 +286,8 @@ Ext.Element.addMethods(function(){ * @return {Ext.Element} this */ setStyle : function(prop, value){ - var tmp, - style, - camel; + var tmp, style; + if (typeof prop != 'object') { tmp = {}; tmp[prop] = value; @@ -511,7 +506,7 @@ Ext.fly('elId').setHeight(150, { }, margins : margins - } + }; }() );