From ef334536b6d302ca42384384fe51ae7462f1a954 Mon Sep 17 00:00:00 2001 From: walsh9 Date: Wed, 16 Feb 2022 13:18:01 -0500 Subject: [PATCH] get images from touts --- addon/components/nypr-brick-item.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addon/components/nypr-brick-item.js b/addon/components/nypr-brick-item.js index de9ff8bd..d1ea11eb 100644 --- a/addon/components/nypr-brick-item.js +++ b/addon/components/nypr-brick-item.js @@ -1,6 +1,6 @@ import Component from '@ember/component'; import { computed } from '@ember/object'; -import { equal } from '@ember/object/computed'; +import { equal, or } from '@ember/object/computed'; import { htmlSafe } from '@ember/string'; import { get } from '@ember/object'; import layout from '../templates/components/nypr-brick-item'; @@ -14,8 +14,9 @@ export default Component.extend({ style: computed.reads('backgroundImage'), vertical: equal('template', 'vertical'), - backgroundImage: computed('item.attributes.imageMain.url', function() { - var imageMain = get(this, 'item.attributes.imageMain'); + imageMain: or('item.attributes.image', 'item.attributes.imageMain'), + backgroundImage: computed('imageMain.url', function() { + var imageMain = get(this, 'imageMain'); var urlString; // fallback image is hosted in publisher