Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Added image preview error management.

luc74b0283d575a
diff --git a/htroot/js/highslide/highslide.js b/htroot/js/highslide/highslide.js
index 4c9399ae1..83d699b30 100644
--- a/htroot/js/highslide/highslide.js
+++ b/htroot/js/highslide/highslide.js
@@ -793,6 +793,12 @@ imageCreate : function() {
img.onload = function () {
if (hs.expanders[exp.key]) exp.contentLoaded();
};
+ /* Manage loading or rendering error */
+ img.onerror = function () {
+ if (hs.expanders[exp.key]) {
+ exp.contentLoaded();
+ }
+ };
img.className = 'highslide-image';
img.style.visibility = 'hidden'; // prevent flickering in IE
img.style.display = 'block';
@@ -800,6 +806,10 @@ imageCreate : function() {
img.style.maxWidth = 'none';
img.style.zIndex = 3;
img.title = hs.restoreTitle;
+ /* Ensure an alternative text and minimum dimensions in case of rendering failure */
+ img.alt = 'X';
+ img.style.minWidth = '3em';
+ img.style.minHeight = '3em';
if (hs.safari) hs.container.appendChild(img);
// uncomment this to flush img size:
// if (hs.ie) img.src = null;