aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/assets')
-rw-r--r--app/src/main/assets/js/context_a.js5
-rw-r--r--app/src/main/assets/js/context_a.min.js5
2 files changed, 6 insertions, 4 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);
diff --git a/app/src/main/assets/js/context_a.min.js b/app/src/main/assets/js/context_a.min.js
index 5c5f033a..97799c33 100644
--- a/app/src/main/assets/js/context_a.min.js
+++ b/app/src/main/assets/js/context_a.min.js
@@ -9,8 +9,9 @@ longClick=!0
"A"!==t.tagName&&(t=t.parentNode),"A"===t.tagName&&"#"!==t.getAttribute("href"))){
var o=t.getAttribute("href")
;if(!o)return
-;var n=t.parentNode.innerText,r=t.parentNode.querySelector('[style*="background-image: url("]')
-;if(r){
+;var n=t.parentNode.innerText,r=t.querySelector('[style*="background-image: url("]')
+;if(r||(r=t.parentNode.querySelector('[style*="background-image: url("]')),
+r){
var a=window.getComputedStyle(r,null).backgroundImage.slice(5,-2)
;console.log("Context image",a),
"undefined"!=typeof Frost&&Frost.loadImage(a,n)