From 1ef55a4fa87d96d9fa8d5424667c458b80542394 Mon Sep 17 00:00:00 2001 From: Sonny Le Date: Wed, 31 Jul 2024 15:34:02 +0700 Subject: [PATCH] Update dark mode for Image Widget --- framework/elements/image/image.php | 10 +++++++++- framework/elements/image/image.xml | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/framework/elements/image/image.php b/framework/elements/image/image.php index 5c900751..21f9be31 100644 --- a/framework/elements/image/image.php +++ b/framework/elements/image/image.php @@ -15,6 +15,7 @@ extract($displayData); $title = $params->get('title', ''); $image = $params->get('image', ''); +$image_dark = $params->get('image_dark', ''); $use_link = $params->get('use_link', 0); $link = $params->get('link', ''); $target = $params->get('target', ''); @@ -39,9 +40,16 @@ if ($use_link) { echo ''; } - echo '
'; + echo '
'; echo ''.$title.''; echo '
'; + if (!empty($image_dark)) { + echo '
'; + echo ''.$title.''; + echo '
'; + $element->style_dark->child('.as-image')->addCss('display', 'none !important'); + $element->style_dark->child('.as-image-dark')->addCss('display', 'inline-block !important'); + } if ($use_link) { echo '
'; } diff --git a/framework/elements/image/image.xml b/framework/elements/image/image.xml index ffed2e11..68bad41b 100644 --- a/framework/elements/image/image.xml +++ b/framework/elements/image/image.xml @@ -9,7 +9,12 @@
- + + + + + +