Clean up some big-mod-buttons frontend code.

This commit is contained in:
Max Goodman
2012-03-06 16:00:41 -08:00
committed by bsimpson63
parent f5b829bcb8
commit 7c6fff648c
3 changed files with 10 additions and 13 deletions

View File

@@ -1103,6 +1103,11 @@ a.star { text-decoration: none; color: #ff8b60 }
.entry .buttons a:hover {text-decoration: underline}
.entry .buttons .status-msg {
display: none;
margin-right: .5em;
}
/* links */
.toggle .error { font-size: x-small; }

View File

@@ -1135,24 +1135,16 @@ function big_mod_action(elem, dir) {
id: thing_id
};
elem.siblings(".status-msg").hide();
if (dir == -1) {
$.request("remove", d, null, true);
elem.siblings(".spammed").show();
elem.siblings(".removed").hide();
elem.siblings(".approved").hide();
} else if (dir == -2) {
d = {
id: thing_id,
spam: false
};
d.spam = false;
$.request("remove", d, null, true);
elem.siblings(".spammed").hide();
elem.siblings(".removed").show();
elem.siblings(".approved").hide();
} else if (dir == 1) {
$.request("approve", d, null, true);
elem.siblings(".spammed").hide();
elem.siblings(".removed").hide();
elem.siblings(".approved").show();
}
}

View File

@@ -140,13 +140,13 @@
%endif
 
<span class="spammed" style="display:none">
<span class="status-msg spammed">
${_("spammed")}
</span>
<span class="removed" style="display:none">
<span class="status-msg removed">
${_("removed")}
</span>
<span class="approved" style="display:none">
<span class="status-msg approved">
${_("approved")}
</span>
</span>