make saved searches table sortable
This commit is contained in:
5
app/assets/javascripts/saved_searches.js
Normal file
5
app/assets/javascripts/saved_searches.js
Normal file
@@ -0,0 +1,5 @@
|
||||
$(document).ready(function() {
|
||||
if ($("#c-saved-searches".length)) {
|
||||
Danbooru.sorttable($("#c-saved-searches table"));
|
||||
}
|
||||
});
|
||||
@@ -120,6 +120,15 @@
|
||||
}
|
||||
};
|
||||
|
||||
Danbooru.sorttable = function(table) {
|
||||
table.stupidtable();
|
||||
table.bind("aftertablesort", function(event, data) {
|
||||
$("#c-saved-searches table tbody tr").removeClass("even odd");
|
||||
$("#c-saved-searches table tbody tr:even").addClass("even");
|
||||
$("#c-saved-searches table tbody tr:odd").addClass("odd");
|
||||
});
|
||||
};
|
||||
|
||||
String.prototype.hash = function() {
|
||||
var hash = 5381, i = this.length;
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
<table class="striped" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="60%">Query</th>
|
||||
<th width="20%">Labels</th>
|
||||
<th data-sort="string" width="60%">Query</th>
|
||||
<th data-sort="string" width="20%">Labels</th>
|
||||
<th width="20%" class="links"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
Reference in New Issue
Block a user