aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js/context_a.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/assets/js/context_a.js')
-rw-r--r--app/src/main/assets/js/context_a.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/assets/js/context_a.js b/app/src/main/assets/js/context_a.js
index c7601764..689c6f0d 100644
--- a/app/src/main/assets/js/context_a.js
+++ b/app/src/main/assets/js/context_a.js
@@ -25,8 +25,9 @@ if (!window.hasOwnProperty('frost_context_a')) {
if (!url) return;
var text = element.parentNode.innerText;
- //check if image item exists
- var image = element.parentNode.querySelector('[style*="background-image: url("]');
+ //check if image item exists, first in children and then in parent
+ var image = element.querySelector('[style*="background-image: url("]');
+ if (!image) image = element.parentNode.querySelector('[style*="background-image: url("]');
if (image) {
var imageUrl = window.getComputedStyle(image, null).backgroundImage.slice(5, -2);
console.log('Context image', imageUrl);