utility.js: simplify even/odd table row striping.

This commit is contained in:
evazion
2018-08-16 21:25:45 -05:00
parent eef8b9c323
commit ad056e69d5
6 changed files with 4 additions and 19 deletions

View File

@@ -2,10 +2,6 @@ import Cookie from './cookie'
import Utility from './utility'
$(function() {
// Table striping
$(".striped tbody tr:even").addClass("even");
$(".striped tbody tr:odd").addClass("odd");
// Account notices
$("#hide-sign-up-notice").click(function(e) {
$("#sign-up-notice").hide();

View File

@@ -1,10 +1,8 @@
import Utility from './utility'
let SavedSearch = {};
SavedSearch.initialize_all = function() {
if ($("#c-saved-searches").length) {
Utility.sorttable($("#c-saved-searches table"));
$("#c-saved-searches table").stupidtable();
}
}

View File

@@ -103,15 +103,6 @@ Utility.regexp_escape = function(string) {
return string.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
}
Utility.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");
});
};
$.fn.selectRange = function(start, end) {
return this.each(function() {
if (this.setSelectionRange) {