From b07bc713bb8574f8d7672c797360c66ff1f68817 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sat, 14 Sep 2013 00:11:30 -0700 Subject: [PATCH] stop trying to load place holder image for placeholder when server is offline. --- UI/Handlebars/Helpers/Html.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/UI/Handlebars/Helpers/Html.js b/UI/Handlebars/Helpers/Html.js index 21534b9ac..55bd4b893 100644 --- a/UI/Handlebars/Helpers/Html.js +++ b/UI/Handlebars/Helpers/Html.js @@ -4,7 +4,16 @@ define( [ 'handlebars' ], function (Handlebars) { + + var placeHolder = '/Content/Images/poster-dark.jpg'; + + window.NzbDrone.imageError = function (img) { + if (!img.src.contains(placeHolder)) { + img.src = placeHolder; + } + }; + Handlebars.registerHelper('defaultImg', function () { - return new Handlebars.SafeString('onerror=this.src=\'/Content/Images/poster-dark.jpg\';'); + return new Handlebars.SafeString('onerror=window.NzbDrone.imageError(this)'); }); });