PDA

View Full Version : How to override Ext.supports.tests



firnnauriel
13 Jul 2016, 8:17 PM
I encountered a similar issue reported here: https://www.sencha.com/forum/showthread.php?132187-Issue-with-the-computed-style-on-hidden-elements-using-Firefox-and-Ext-JS-4&p=1140339

Fortunately, changing some lines in Ext.supports fixed it. I know how to override Ext classes, but it seems Ext.supports is a different thing. What's the right way to override it w/o modifying the actual ext-all.js?

I would like to apply these changes in the tests property:


{
identity: 'RightMargin',
fn: function(doc, div) {
var view = doc.defaultView;
return !(view && (view.getComputedStyle(div.firstChild.firstChild, null) || { marginRight: '0px' }).marginRight != '0px');
}
},
...
{
identity: 'TransparentColor',
fn: function(doc, div, view) {
view = doc.defaultView;
return !(view && (view.getComputedStyle(div.lastChild, null) || { backgroundColor: 'transparent' }).backgroundColor != 'transparent');
}
}

firnnauriel
28 Jul 2016, 6:46 PM
Looks like there's no way to override Ext.supports.tests. I found this thread and already tried similar approach but it still didn't work: https://www.sencha.com/forum/showthread.php?149787-Override-Singleton-Ext.supports

Is there anyone that can confirm my findings? I'll greatly appreciate it. TIA!