-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
221 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
$(document).ready(function() { | ||
var activeSystemClass = $('.list-group-item.active'); | ||
|
||
//something is entered in search form | ||
$('#system-search').keyup( function() { | ||
var that = this; | ||
// affect all table rows on in systems table | ||
var tableBody = $('.table-list-search tbody'); | ||
var tableRowsClass = $('.table-list-search tbody tr'); | ||
$('.search-sf').remove(); | ||
tableRowsClass.each( function(i, val) { | ||
|
||
//Lower text for case insensitive | ||
var rowText = $(val).text().toLowerCase(); | ||
var inputText = $(that).val().toLowerCase(); | ||
if(inputText != '') | ||
{ | ||
$('.search-query-sf').remove(); | ||
tableBody.prepend('<tr class="search-query-sf"><td colspan="6"><strong>Searching for: "' | ||
+ $(that).val() | ||
+ '"</strong></td></tr>'); | ||
} | ||
else | ||
{ | ||
$('.search-query-sf').remove(); | ||
} | ||
|
||
if( rowText.indexOf( inputText ) == -1 ) | ||
{ | ||
//hide rows | ||
tableRowsClass.eq(i).hide(); | ||
|
||
} | ||
else | ||
{ | ||
$('.search-sf').remove(); | ||
tableRowsClass.eq(i).show(); | ||
} | ||
}); | ||
//all tr elements are hidden | ||
if(tableRowsClass.children(':visible').length == 0) | ||
{ | ||
tableBody.append('<tr class="search-sf"><td class="text-muted" colspan="6">No entries found.</td></tr>'); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.