Changed style of network select in Order
This commit is contained in:
@@ -977,18 +977,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('#filter_network_id').select2({sorter: function(data) {
|
||||
return data.sort(function (a, b) {
|
||||
if (a.text > b.text) {
|
||||
return 1;
|
||||
}
|
||||
if (a.text < b.text) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
});
|
||||
sortSelect(document.getElementById("filter_network_id"));
|
||||
|
||||
var order;
|
||||
var hash = window.location.hash.substr(1);
|
||||
@@ -1131,6 +1120,24 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
function sortSelect(selElem) {
|
||||
var tmpAry = new Array();
|
||||
for (var i=0;i<selElem.options.length;i++) {
|
||||
tmpAry[i] = new Array();
|
||||
tmpAry[i][0] = selElem.options[i].text;
|
||||
tmpAry[i][1] = selElem.options[i].value;
|
||||
}
|
||||
tmpAry.sort();
|
||||
while (selElem.options.length > 0) {
|
||||
selElem.options[0] = null;
|
||||
}
|
||||
for (var i=0;i<tmpAry.length;i++) {
|
||||
var op = new Option(tmpAry[i][0], tmpAry[i][1]);
|
||||
selElem.options[i] = op;
|
||||
}
|
||||
return;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../")."/footer.php"); ?>
|
||||
|
||||
Reference in New Issue
Block a user