Avoiding unnecessary repeated checks of navigator.userAgent. The constants added here should not be used outside the library. In the future, they should be removed from the library. r=ahocevar (closes #2911)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10868 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2010-11-03 00:10:00 +00:00
parent 89c215bba4
commit aa9112c494
27 changed files with 91 additions and 81 deletions
+3 -3
View File
@@ -589,7 +589,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
// before continuing execution.
if (OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,
this.layer.transitionEffect) != -1) {
if (navigator.userAgent.toLowerCase().indexOf("gecko") != -1) {
if (OpenLayers.IS_GECKO === true) {
this.frame.scrollLeft = this.frame.scrollLeft;
}
}
@@ -608,5 +608,5 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
);
OpenLayers.Tile.Image.useBlankTile = (
OpenLayers.Util.getBrowserName() == "safari" ||
OpenLayers.Util.getBrowserName() == "opera");
OpenLayers.BROWSER_NAME == "safari" ||
OpenLayers.BROWSER_NAME == "opera");
+2 -2
View File
@@ -84,7 +84,7 @@ OpenLayers.Tile.Image.IFrame = {
if (this.imgDiv == null) {
var eventPane = document.createElement("div");
if(OpenLayers.Util.getBrowserName() == "msie") {
if(OpenLayers.BROWSER_NAME == "msie") {
// IE cannot handle events on elements without backgroundcolor.
// So we use this little hack to make elements transparent
eventPane.style.backgroundColor = '#FFFFFF';
@@ -131,7 +131,7 @@ OpenLayers.Tile.Image.IFrame = {
createIFrame: function() {
var id = this.id+'_iFrame';
var iframe;
if(OpenLayers.Util.getBrowserName() == "msie") {
if(OpenLayers.BROWSER_NAME == "msie") {
// InternetExplorer does not set the name attribute of an iFrame
// properly via DOM manipulation, so we need to do it on our own with
// this hack.