Skip to content

Commit

Permalink
Add possibility to filter alias reference list (#2228)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger authored Oct 18, 2021
1 parent 996a192 commit 6852040
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 6 additions & 2 deletions input/_DslSidebar.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@
<hr>

<div id="aliasCategories">
<i id="aliasCategorySearchIcon" class="fa fa-filter"></i>
<input id="aliasCategorySearch" type="text" class="search" aria-label="Enter categories to which should be filtered" placeholder="Filter categories..." autocomplete="off" value>

<ul class="list sidebar-menu" style="display:none;">
@foreach(Tuple<string, IDocument> category in categories)
{
string selectedClass = category.Item1 == Model.String(Keys.GroupKey) ? "selected" : null;
bool containsBuiltInAliases = category.Item2.Bool("ContainsBuiltInAliases");
<li class="@selectedClass" data-builtin="@containsBuiltInAliases"><a href="@Context.GetLink(category.Item2)">@category.Item1</a></li>
<li class="@selectedClass" data-name="@category.Item1" data-builtin="@containsBuiltInAliases"><a href="@Context.GetLink(category.Item2)">@category.Item1</a></li>
}
</ul>
</div>
Expand Down Expand Up @@ -80,7 +83,8 @@
// Initialize list.js
var options = {
valueNames: [
{ data: ['builtin'] }
{ data: ['name'] },
{ data: ['builtin'] }
]
};
var categoryList = new List('aliasCategories', options);
Expand Down
14 changes: 13 additions & 1 deletion input/assets/css/override.less
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,18 @@ ul.share-buttons img{
height: 34px;
}

#aliasCategorySearch {
width: 100%;
margin-bottom: 15px;
padding-left: 20px;
}

#aliasCategorySearchIcon {
position:absolute;
top: 92px;
left: 5px;
}

// Extension list

#search {
Expand Down Expand Up @@ -252,4 +264,4 @@ ul.share-buttons img{
.main-sidebar .sidebar {
margin-top: 30px;
}
}
}

0 comments on commit 6852040

Please sign in to comment.