Skip to content

Commit

Permalink
Add a category label when searching on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
fpigerre committed Jan 15, 2016
1 parent af3e9a2 commit ed0e77b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _includes/mobile-table.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% assign section = include.variable-param %}
{% assign section_file = site.data[section.id] %}
<div class="website-table mobile-table {{ section.id }}-table" id="{{ section.id }}-mobiletable" style="display:none">
<div class="label">
<h3>{{ section.title }}</h3>
</div>
<div class="jets-content">
{% for website in section_file.websites %}
{% if website.status %}
Expand Down
6 changes: 6 additions & 0 deletions css/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ input[type=search] {
.mobile-table {
display: none;

.label {
display: none;
padding: 15px 0;
text-align: center;
}

.jets-content {
border: 1px groove rgba(34, 36, 38, 0.14902);
border-radius: 5px;
Expand Down
2 changes: 2 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ var jets = new Jets({
// Non-strict comparison operator is used to allow for null
if (searchPhrase == '') {
$('.website-table').css('display', 'none');
$('.website-table .label').css('display', 'none');
$('.category').show();
$('table').show();
isSearching = false;
} else {
$('.website-table').css('display', 'none');
$('.website-table .label').css('display', 'block');
$('.category').hide();
table.css('display', 'block');
content.parent().show();
Expand Down

0 comments on commit ed0e77b

Please sign in to comment.