From 5ff9bbadf5d1d00881238230789d24d2579cba7c Mon Sep 17 00:00:00 2001 From: rmartin Date: Mon, 18 Dec 2023 10:14:45 +0100 Subject: [PATCH 1/2] round bbox value --- lizmap/modules/view/classes/lizmapMainViewItem.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lizmap/modules/view/classes/lizmapMainViewItem.class.php b/lizmap/modules/view/classes/lizmapMainViewItem.class.php index fc909783d9..6630d6deb5 100644 --- a/lizmap/modules/view/classes/lizmapMainViewItem.class.php +++ b/lizmap/modules/view/classes/lizmapMainViewItem.class.php @@ -35,7 +35,7 @@ public function __construct($id, $title, $abstract = '', $keywordList = '', $pro $this->abstract = $abstract; $this->keywordList = $keywordList; $this->proj = $proj; - $this->bbox = $bbox; + $this->bbox = preg_replace('/([0-9]+\.[0-9]{2})[0-9]+/', '$1', $bbox); $this->url = $url; $this->img = $img; $this->order = $order; From d2926632646557ad8b0211edb6db47addf05042b Mon Sep 17 00:00:00 2001 From: rmartin Date: Mon, 18 Dec 2023 10:18:10 +0100 Subject: [PATCH 2/2] use css transitions instead of js --- assets/src/legacy/view.js | 14 -------------- lizmap/modules/view/templates/view.tpl | 6 ++++-- lizmap/www/assets/css/view.css | 10 ++++++++-- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/assets/src/legacy/view.js b/assets/src/legacy/view.js index 8d19529bf0..633b119ac1 100644 --- a/assets/src/legacy/view.js +++ b/assets/src/legacy/view.js @@ -1,16 +1,3 @@ -var addDescriptionSlider = function(){ - $('.liz-project-img').parent().mouseenter(function(){ - var self = $(this); - self.find('.liz-project-desc').slideDown(); - }).mouseleave(function(){ - var self = $(this); - self.find('.liz-project-desc').hide(); - }).click(function(){ - var self = $(this); - window.location = self.parent().find('a.liz-project-view').attr('href'); - return false; - }); -} var searchProjects = function(){ // Hide search if there are no projects @@ -287,6 +274,5 @@ var searchProjects = function(){ } window.addEventListener('load', function () { - addDescriptionSlider(); searchProjects(); }); diff --git a/lizmap/modules/view/templates/view.tpl b/lizmap/modules/view/templates/view.tpl index d125dae95c..98bc5175c6 100644 --- a/lizmap/modules/view/templates/view.tpl +++ b/lizmap/modules/view/templates/view.tpl @@ -14,8 +14,9 @@
{$p->title}

diff --git a/lizmap/www/assets/css/view.css b/lizmap/www/assets/css/view.css index 6460ee1dbf..ef47aef14e 100644 --- a/lizmap/www/assets/css/view.css +++ b/lizmap/www/assets/css/view.css @@ -20,7 +20,7 @@ .liz-project-desc { color: white; font-size: 0.8em; - line-height: 0.8em; + line-height: 0em; position: absolute; bottom:-1px; right:0px; @@ -28,10 +28,16 @@ text-align: left; text-transform: none; background-color: rgba(0, 0, 0, 0.5); - padding:5px; + padding:0px; margin:0px; overflow-wrap: break-word; } +.liz-project:hover .liz-project-desc { + line-height: 0.8em; + transition: line-height 300ms ease-in; + padding:5px; +} + .liz-project-title{ overflow-wrap: anywhere;