Commit a9e7890d by Valera Rozuvan Committed by Alexander Kryklia

Added correct handling of invalid (missing) base images. Now error is reported,…

Added correct handling of invalid (missing) base images. Now error is reported, and the damage is reduced to a minimum.
parent 98172538
......@@ -23,6 +23,7 @@ define(['logme'], function (logme) {
);
state.baseImageEl = $('<img />');
state.baseImageEl.attr(
'src',
state.config.imageDir + '/' + state.config.base_image
......@@ -36,6 +37,19 @@ define(['logme'], function (logme) {
state.baseImageLoaded = true;
});
state.baseImageEl.error(function () {
logme(
'ERROR: Image "' + state.config.imageDir + '/' +
state.config.base_image + '" was not found!'
);
baseImageElContainer.html(
'<span style="color: red;">' +
'ERROR: Image "' + state.config.imageDir + '/' +
state.config.base_image + '" was not found!' +
'</span>'
);
baseImageElContainer.appendTo(state.containerEl);
});
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment