Skip to content

Commit 51c20cb

Browse files
mnocondew326adriendupuis
authored
Mark higher-level nodes with "New" pill as well, not only the actual item (#2429)
* Mark higher-level nodes with "New pill", not only the actual item * Before review * Update docs/js/custom.js Co-authored-by: Dariusz Szut <dew326@gmail.com> * Applied review suggestion Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> --------- Co-authored-by: Dariusz Szut <dew326@gmail.com> Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
1 parent b8bca02 commit 51c20cb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/js/custom.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,7 @@ $(document).ready(function() {
202202
closeBtn.closest('.notification').setAttribute('hidden', 'hidden');
203203
});
204204
});
205+
206+
// Mark higher-level nodes with "New" pill, not only the actual item
207+
$(".pill.new:not([hidden])").parents(".md-nav__item").children('label').children(".pill.new[hidden]").removeAttr('hidden');
205208
});

theme/partials/nav-item.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% set checked = "checked" if nav_item.active %}
88
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" type="checkbox" id="{{ path }}" {{ checked }}>
99
<label class="md-nav__link level-{{ level }}" for="{{ path }}">
10-
{{ nav_item.title }}
10+
{{ nav_item.title }} <span class="pill new" hidden>New</span>
1111
</label>
1212
<nav class="md-nav" aria-label="{{ nav_item.title }}" data-md-level="{{ level }}">
1313
<label class="md-nav__link-title md-nav__link level-{{ level }}" for="{{ path }}">

0 commit comments

Comments
 (0)