Keep the Util.alphaHack function result in a cache. r=pgiraud (closes #1825)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@8419 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -390,6 +390,12 @@ OpenLayers.Util.onImageLoadError = function() {
|
||||
this.style.display = "";
|
||||
};
|
||||
|
||||
/**
|
||||
* Property: alphaHackNeeded
|
||||
* {Boolean} true if the png alpha hack is necessary and possible, false otherwise.
|
||||
*/
|
||||
OpenLayers.Util.alphaHackNeeded = null;
|
||||
|
||||
/**
|
||||
* Function: alphaHack
|
||||
* Checks whether it's necessary (and possible) to use the png alpha
|
||||
@@ -397,9 +403,10 @@ OpenLayers.Util.onImageLoadError = function() {
|
||||
* Explorer.
|
||||
*
|
||||
* Returns:
|
||||
* {Boolean} true if alpha has is necessary and possible, false otherwise.
|
||||
* {Boolean} true if the png alpha hack is necessary and possible, false otherwise.
|
||||
*/
|
||||
OpenLayers.Util.alphaHack = function() {
|
||||
if (OpenLayers.Util.alphaHackNeeded == null) {
|
||||
var arVersion = navigator.appVersion.split("MSIE");
|
||||
var version = parseFloat(arVersion[1]);
|
||||
var filter = false;
|
||||
@@ -411,11 +418,12 @@ OpenLayers.Util.alphaHack = function() {
|
||||
|
||||
try {
|
||||
filter = !!(document.body.filters);
|
||||
} catch (e) {
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
return ( filter &&
|
||||
(version >= 5.5) && (version < 7) );
|
||||
OpenLayers.Util.alphaHackNeeded = (filter &&
|
||||
(version >= 5.5) && (version < 7));
|
||||
}
|
||||
return OpenLayers.Util.alphaHackNeeded;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user