sonarr-repo-only/UI/Handlebars/Helpers/Html.js

21 lines
517 B
JavaScript
Raw Normal View History

2013-06-25 04:43:16 +00:00
'use strict';
define(
[
'handlebars'
], function (Handlebars) {
var placeHolder = '/Content/Images/poster-dark.jpg';
window.NzbDrone.imageError = function (img) {
if (!img.src.contains(placeHolder)) {
img.src = placeHolder;
}
2013-09-14 19:50:38 +00:00
img.onerror = null;
};
2013-06-25 04:43:16 +00:00
Handlebars.registerHelper('defaultImg', function () {
return new Handlebars.SafeString('onerror=window.NzbDrone.imageError(this)');
2013-06-25 04:43:16 +00:00
});
});