News Dashlet - Fix styling of unread items
authorcolemanw <coleman@civicrm.org>
Tue, 20 Feb 2024 22:34:02 +0000 (17:34 -0500)
committercolemanw <coleman@civicrm.org>
Tue, 20 Feb 2024 23:15:46 +0000 (18:15 -0500)
Adjusts css to target the new disclosure element markup,
and removes dependence on the deprecated `crmAccordion:open` event.

templates/CRM/Dashlet/Page/Blog.tpl

index cdf9edc472d10e8428886210bcb0a17888994bb3..52edd33caf1ae6656e67fcea803b51b378c97bfb 100644 (file)
   #civicrm-news-feed .crm-news-feed-unread .crm-news-feed-item-title {
     font-weight: bold;
   }
-  #civicrm-news-feed .collapsed .crm-accordion-header {
+  #civicrm-news-feed details:not([open]) .crm-accordion-header {
     text-overflow: ellipsis;
     text-wrap: none;
     white-space: nowrap;
     overflow: hidden;
   }
   #civicrm-news-feed .crm-news-feed-item-preview {
+    display: inline;
     color: #8d8d8d;
-    display: none;
   }
-  #civicrm-news-feed .collapsed .crm-news-feed-item-preview {
-    display: inline;
+  #civicrm-news-feed details[open] .crm-news-feed-item-preview {
+    display: none;
   }
   #civicrm-news-feed .crm-news-feed-item-link {
     margin-bottom: 0;
@@ -88,7 +88,7 @@
             if ($.inArray(itemKey, opened[key]) < 0) {
               $(this).addClass('crm-news-feed-unread');
               ++count;
-              $(this).one('crmAccordion:open', function () {
+              $(this).one('click', function () {
                 $(this).removeClass('crm-news-feed-unread');
                 $('em', $tab).text(--count || '');
                 opened[key].push(itemKey);