From 8603e196173014c6c83de37c80b3e9feed1fe92d Mon Sep 17 00:00:00 2001 From: TheOrangeOne Date: Thu, 25 Aug 2016 21:51:52 +0100 Subject: [PATCH] cleanup image div script --- theme/static/src/js/app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/theme/static/src/js/app.js b/theme/static/src/js/app.js index 8b33246..6afacca 100644 --- a/theme/static/src/js/app.js +++ b/theme/static/src/js/app.js @@ -2,5 +2,9 @@ import './creative'; $('.image').each(function () { const ele = $(this); - ele.css('background-image', 'url(' + ele.data('image') + ')'); + if (ele.data('image')) { + ele.css('background-image', 'url(' + ele.data('image') + ')'); + } else { + ele.removeClass('image'); + } });