Turned "search in notes" into "has docs". Added cool icons. Fixed animation of No results.

This commit is contained in:
2018-11-12 14:31:31 +01:00
parent 005ea98f59
commit 257a8d9754
4 changed files with 18 additions and 22 deletions
+4 -6
View File
@@ -169,13 +169,14 @@ function show_part_info(partID) {
}
function perform_query() {
$('#no-results').stop();
$('#no-results').css("opacity", 0);
var query = $('.search-bar').val();
var data = {
l:$('#type').is(':checked'),
p:$('#partno').is(':checked'),
d:$('#description').is(':checked'),
n:$('#notes').is(':checked')
n:$('#has-docs').is(':checked')
};
filter = '0';
$("#results").find("tr:not(:first)").remove(); // Delete all table rows
@@ -192,10 +193,7 @@ function perform_query() {
$('#no-results').animate({opacity:1},2000);
}
}).fail(function() {
var newResults = '<div class="results">';
newResults += '<h3>No results.</h3>';
newResults += '</div>';
$('.results').replaceWith(newResults);
$('#no-results').animate({opacity:1},2000);
console.log( "Query failed" );
});
}
@@ -222,7 +220,7 @@ $(document).ready(function() {
if ( !$('#location').is(':checked')
&& !$('#partno').is(':checked')
&& !$('#description').is(':checked')
&& !$('#notes').is(':checked'))
&& !$('#has-docs').is(':checked'))
$(this).prop('checked', true);
else
perform_query();
+2 -3
View File
@@ -59,7 +59,6 @@ input[type=text].search-bar {
padding: 10pt 15pt 10pt 15pt;
margin-top: 10pt;
margin-bottom: 10pt;
border-radius: 2pt;
display: inline-block;
}
@@ -81,7 +80,6 @@ input[type=checkbox]{
}
input[type=checkbox] + label.toggle-btn {
border-radius: 3pt;
display: inline-block;
padding: 5pt;
color: #D7E2E2;
@@ -89,7 +87,8 @@ input[type=checkbox] + label.toggle-btn {
margin-bottom: 6pt;
margin-left: 3pt;
margin-right: 3pt;
width: 100pt;
width: 80pt;
line-height: 300%;
text-align: center;
border: 1pt solid #D7E2E2;
transition: 0.2s;