Skip to content
Snippets Groups Projects
Commit b820d1a3 authored by Daniel Brown's avatar Daniel Brown
Browse files

added kat list sorting so kats are easier to find

parent b978043b
Branches
No related tags found
No related merge requests found
......@@ -100,6 +100,17 @@
<script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
<script type="text/JavaScript">
function sortKatList(list){
// resort alphabetically the options visible
var rvals = $(list);
var opts = rvals.children("option");
opts.sort(function(a, b) {
return $(a).text().toUpperCase().localeCompare($(b).text().toUpperCase());
});
$.each(opts, function(idx, itm) { rvals.append(itm); });
}
$(document).ready(function(){
updateBranches();
......@@ -114,6 +125,7 @@
});
$('#txtKatSearch').change(function(){
term = $('#txtKatSearch').val();
term.trim();
......@@ -125,16 +137,20 @@
match = $("#rightValues :not(:contains('" + term + "'))");
match.wrap("<span></span>");
}
sortKatList("#rightValues");
});
$("#btnLeft").click(function () {
var selectedItem = $("#rightValues option:selected");
$("#leftValues").append(selectedItem);
sortKatList("#leftValues");
});
$("#btnRight").click(function () {
var selectedItem = $("#leftValues option:selected");
$("#rightValues").append(selectedItem);
sortKatList("#rightValues");
});
$('#btnGetPrevTests').click(function(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment