From c6d6c6cbfe2f1f68521c12628379535f4dff4b57 Mon Sep 17 00:00:00 2001 From: raviks789 Date: Wed, 20 Mar 2024 15:27:12 +0100 Subject: [PATCH 1/2] BaseItemList: Emit events before and after adding the list item to the list --- src/Common/BaseItemList.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Common/BaseItemList.php b/src/Common/BaseItemList.php index ce0946c8..8320d1c1 100644 --- a/src/Common/BaseItemList.php +++ b/src/Common/BaseItemList.php @@ -15,6 +15,12 @@ abstract class BaseItemList extends BaseHtmlElement { use BaseFilter; + /** @var string Emitted while assembling the list after adding each list item */ + public const ON_ITEM_ADD = 'item-added'; + + /** @var string Emitted while assembling the list before adding each list item */ + public const BEFORE_ITEM_ADD = 'before-item-add'; + /** @var array */ protected $baseAttributes = [ 'class' => ['item-list', 'default-layout'], @@ -62,7 +68,9 @@ protected function assemble(): void foreach ($this->data as $data) { /** @var BaseListItem|BaseTableRowItem $item */ $item = new $itemClass($data, $this); + $this->emit(self::BEFORE_ITEM_ADD, [$item, $data]); $this->addHtml($item); + $this->emit(self::ON_ITEM_ADD, [$item, $data]); } if ($this->isEmpty()) { From dc51003583587849d2124d38e7f4a9947998dd2a Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 28 May 2024 11:49:28 +0200 Subject: [PATCH 2/2] list-item: Add hover color for `.subject` --- asset/css/list/list-item.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/asset/css/list/list-item.less b/asset/css/list/list-item.less index 56a43a39..41b66ff4 100644 --- a/asset/css/list/list-item.less +++ b/asset/css/list/list-item.less @@ -33,6 +33,10 @@ &:hover { color: @list-item-title-hover-color; text-decoration: none; + + .subject { + color: @list-item-title-hover-color; + } } } }