Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion assets/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,27 @@ export const initializeNav = () => {
nav.attr('aria-expanded', btn.attr('aria-pressed'));
}
};

screenTest(mql);
mql.addListener(screenTest);
}
};

const filterSiblings = (selector, filter) => {
$(`${selector} ~ section`).each((idx, node) => {
if (filter === '' || node.id.includes(filter)) {
$(node).show();
} else {
$(node).hide();
}
});
};

export const initializePageFilters = () => {
$('#page-filter').submit(event => {
event.preventDefault();
return false;
});
$('#page-filter input').keyup(() => {
filterSiblings('#page-filter', $('#page-filter input').val());
});
};
1 change: 1 addition & 0 deletions assets/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ $(() => {
base.initializeToggles();
base.initializeIframes();
base.initializeNav();
base.initializePageFilters();
});
1 change: 1 addition & 0 deletions dist/js/base.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/js/init.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions docs/api_json-export.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ <h3 data-sassdoc="nav-title">
<div data-sassdoc-page="api_json-export">



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
1 change: 1 addition & 0 deletions docs/assets/js/base.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/assets/js/init.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions docs/config-colors.html
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@ <h4 class="param-title">
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/config-fonts.html
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@ <h4 class="param-title">
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/config-scale.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ <h3 data-sassdoc="nav-title">
<div data-sassdoc-page="config-scale">



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/config-utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ <h1 id="herman-config-private-helpers">Herman Config: Private<span class="widont
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/config-z-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@ <h4 class="param-title">
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/config_api-utilities.html
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ <h1 id="private-api-utilities">Private API Utilities</h1>
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/demo_colors.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ <h3 data-sassdoc="nav-title">
<div data-sassdoc-page="demo_colors">



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/demo_examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ <h3 data-sassdoc="nav-title">
<div data-sassdoc-page="demo_examples">



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/demo_fonts.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ <h3 data-sassdoc="nav-title">
<div data-sassdoc-page="demo_fonts">



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/demo_icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ <h3 data-sassdoc="nav-title">
<div data-sassdoc-page="demo_icons">



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/demo_sizes.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ <h3 data-sassdoc="nav-title">
<div data-sassdoc-page="demo_sizes">



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/demo_test-sassdoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ <h1 id="sassdoc-annotations">SassDoc Annotations</h1>
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/style-code.html
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@ <h4 class="param-title">
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/style-icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ <h3 class="item-subtitle">
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/style-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ <h1 id="herman-navigation-component">Herman Navigation Component</h1>
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/style-sections.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ <h1 id="herman-section-arrow-component">Herman Section-Arrow Component</h1>
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
6 changes: 6 additions & 0 deletions docs/style-typography.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ <h1 id="herman-typography">Herman Typography</h1>
</section>



<form id="page-filter">
<input placeholder="filter">
</form>





Expand Down
3 changes: 3 additions & 0 deletions templates/filter_form.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<form id="page-filter">
<input placeholder="filter">
</form>
1 change: 1 addition & 0 deletions templates/group.njk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{% endblock %}

{% block main %}
{% include 'filter_form.j2' %}
{% for item in items %}
{% set type = item.context.type %}
{% include 'item/_item.njk' %}
Expand Down