do not change the src of broken images, as this prevents from being able to right-click on the image and see the server error, p=rdewit, r=me (closes #2318)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9771 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -380,7 +380,6 @@ OpenLayers.Util.onImageLoadError = function() {
|
|||||||
this.src = this.src;
|
this.src = this.src;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.src = OpenLayers.Util.getImagesLocation() + "blank.gif";
|
|
||||||
OpenLayers.Element.addClass(this, "olImageLoadError");
|
OpenLayers.Element.addClass(this, "olImageLoadError");
|
||||||
}
|
}
|
||||||
this.style.display = "";
|
this.style.display = "";
|
||||||
|
|||||||
+2
-5
@@ -177,15 +177,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_Util_imageLoadError(t) {
|
function test_Util_imageLoadError(t) {
|
||||||
t.plan(2);
|
t.plan(1);
|
||||||
|
|
||||||
var blank_image_url = OpenLayers.Util.getImagesLocation() + "blank.gif";
|
var img = OpenLayers.Util.createImage(null, null, null, null, null, null, null, false);
|
||||||
var img = OpenLayers.Util.createImage(null, null, null, null, null, null,
|
|
||||||
null, false);
|
|
||||||
|
|
||||||
img._attempts = OpenLayers.IMAGE_RELOAD_ATTEMPTS + 1;
|
img._attempts = OpenLayers.IMAGE_RELOAD_ATTEMPTS + 1;
|
||||||
OpenLayers.Util.onImageLoadError.call(img);
|
OpenLayers.Util.onImageLoadError.call(img);
|
||||||
t.ok(OpenLayers.Util.isEquivalentUrl(blank_image_url, img.src), 'broken image correctly has url for blank image as src');
|
|
||||||
t.ok(OpenLayers.Element.hasClass(img, 'olImageLoadError'), 'broken image has class olImageLoadError');
|
t.ok(OpenLayers.Element.hasClass(img, 'olImageLoadError'), 'broken image has class olImageLoadError');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ rel="stylesheet" type="text/css">
|
|||||||
|
|
||||||
/* avoid pink tiles */
|
/* avoid pink tiles */
|
||||||
.olImageLoadError {
|
.olImageLoadError {
|
||||||
border: none !important;
|
background-color: transparent !important;
|
||||||
background: none !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.olControlAttribution { bottom: 0px!important }
|
.olControlAttribution { bottom: 0px!important }
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
|
|
||||||
/* avoid pink tiles */
|
/* avoid pink tiles */
|
||||||
.olImageLoadError {
|
.olImageLoadError {
|
||||||
border: none !important;
|
background-color: transparent !important;
|
||||||
background: none !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -323,10 +323,9 @@ div.olControlSaveFeaturesItemInactive {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.olImageLoadError {
|
.olImageLoadError {
|
||||||
border: ridge 2px gray;
|
background-color: pink;
|
||||||
background: pink url("img/broken.png");
|
opacity: 0.5;
|
||||||
background-repeat: no-repeat;
|
filter: alpha(opacity=50); /* IE */
|
||||||
background-position: 5px 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user