mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-13 03:42:27 +00:00
Simplify restripe_rows
This commit is contained in:
parent
d98ba93c88
commit
e191ae11ab
1 changed files with 10 additions and 18 deletions
|
@ -734,7 +734,7 @@ function batch_recording_rels() {
|
||||||
|
|
||||||
if (hide_performed_recs) {
|
if (hide_performed_recs) {
|
||||||
$recordings.filter(".performed").hide();
|
$recordings.filter(".performed").hide();
|
||||||
restripe_rows();
|
restripeRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
callback && callback();
|
callback && callback();
|
||||||
|
@ -1467,7 +1467,7 @@ function batch_recording_rels() {
|
||||||
if (hide_performed_recs) {
|
if (hide_performed_recs) {
|
||||||
$row.find("input[name=add-to-merge]").attr("checked", false);
|
$row.find("input[name=add-to-merge]").attr("checked", false);
|
||||||
$row.hide();
|
$row.hide();
|
||||||
restripe_rows();
|
restripeRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (callback)
|
if (callback)
|
||||||
|
@ -1504,7 +1504,7 @@ function batch_recording_rels() {
|
||||||
$rec.hide().data("filtered", true);
|
$rec.hide().data("filtered", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
restripe_rows();
|
restripeRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggle_performed_recordings() {
|
function toggle_performed_recordings() {
|
||||||
|
@ -1517,7 +1517,7 @@ function batch_recording_rels() {
|
||||||
} else {
|
} else {
|
||||||
$performed.filter(function() {return !$(this).data("filtered");}).show();
|
$performed.filter(function() {return !$(this).data("filtered");}).show();
|
||||||
}
|
}
|
||||||
restripe_rows();
|
restripeRows();
|
||||||
$.cookie('hide_performed_recs', hide_performed_recs.toString(), { path: '/', expires: 1000 });
|
$.cookie('hide_performed_recs', hide_performed_recs.toString(), { path: '/', expires: 1000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1534,7 +1534,7 @@ function batch_recording_rels() {
|
||||||
} else {
|
} else {
|
||||||
$pending.filter(function() {return !$(this).data("filtered");}).show();
|
$pending.filter(function() {return !$(this).data("filtered");}).show();
|
||||||
}
|
}
|
||||||
restripe_rows();
|
restripeRows();
|
||||||
$.cookie('hide_pending_edits', hide_pending_edits.toString(), { path: '/', expires: 1000 });
|
$.cookie('hide_pending_edits', hide_pending_edits.toString(), { path: '/', expires: 1000 });
|
||||||
}
|
}
|
||||||
toggle_pending_edits(null, hide_pending_edits);
|
toggle_pending_edits(null, hide_pending_edits);
|
||||||
|
@ -1573,19 +1573,11 @@ function batch_recording_rels() {
|
||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
function restripe_rows() {
|
function restripeRows() {
|
||||||
var $rows = $recordings.filter(":visible"),
|
$recordings.filter(":visible").each(function (index, row) {
|
||||||
row, even = false;
|
var even = (index + 1) % 2 === 0;
|
||||||
|
row.className = row.className.replace(even ? 'odd' : 'even', even ? 'even' : 'odd');
|
||||||
for (var i = 0; i < $rows.length; i++) {
|
});
|
||||||
row = $rows[i];
|
|
||||||
if (even) {
|
|
||||||
$(row).addClass("ev");
|
|
||||||
} else {
|
|
||||||
$(row).removeClass("ev");
|
|
||||||
}
|
|
||||||
even = !even;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function rowTitleCell($row) {
|
function rowTitleCell($row) {
|
||||||
|
|
Loading…
Reference in a new issue