1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-29 03:05:49 +00:00
Sonarr/UI/Handlebars/Helpers/Html.js
2013-09-14 12:50:38 -07:00

20 lines
517 B
JavaScript

'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;
}
img.onerror = null;
};
Handlebars.registerHelper('defaultImg', function () {
return new Handlebars.SafeString('onerror=window.NzbDrone.imageError(this)');
});
});