Fix bans page
This commit is contained in:
parent
7a7569da3b
commit
a028434e94
|
@ -28,14 +28,28 @@ $.fn.longtable = function(fields, options, data) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
el = $("<td></td>");
|
el = $("<td></td>");
|
||||||
if (fields[field].fmt) { // Special formatting?
|
if (fields[field].fmt) {
|
||||||
|
// Apply ad-hoc formatting.
|
||||||
el.html(fields[field].fmt(data[id]));
|
el.html(fields[field].fmt(data[id]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
el.html(data[id][field]);
|
el.html(data[id][field]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fields[field].handle_longwords) {
|
||||||
|
el.css("word-break", "break-all");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fields[field].max_width) {
|
||||||
|
el.css("max-width", fields[field].max_width);
|
||||||
|
}
|
||||||
el.css("width", fields[field].width);
|
el.css("width", fields[field].width);
|
||||||
|
|
||||||
|
if (fields[field].max_height) {
|
||||||
|
el.css("max-height", fields[field].max_height);
|
||||||
|
}
|
||||||
|
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
_gen_tr: function(id) {
|
_gen_tr: function(id) {
|
||||||
|
@ -111,11 +125,12 @@ $.fn.longtable = function(fields, options, data) {
|
||||||
first = Math.floor(first / options.row_h);
|
first = Math.floor(first / options.row_h);
|
||||||
last = Math.ceil (last / options.row_h);
|
last = Math.ceil (last / options.row_h);
|
||||||
|
|
||||||
first = first < 0 ? 0 : first;
|
first = first < 1 ? 1 : first;
|
||||||
last = last >= data.length ? data.length - 1 : last;
|
last = last >= data.length ? data.length - 1 : last;
|
||||||
|
|
||||||
$.each(shown_rows, function(id) {
|
$.each(shown_rows, function(id) {
|
||||||
if (id < first || id > last) {
|
// Remove only the rows after.
|
||||||
|
if (id > last) {
|
||||||
lt._remove(id);
|
lt._remove(id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,7 +37,7 @@ var banlist_init = function(token, my_boards, inMod) {
|
||||||
}
|
}
|
||||||
return pre+f.mask;
|
return pre+f.mask;
|
||||||
} },
|
} },
|
||||||
reason: {name: _("Reason"), width: "calc(100% - 715px - 6 * 4px)", fmt: function(f) {
|
reason: {name: _("Reason"), width: "40%", max_width: "40%", max_height: "240px", handle_longwords: true, fmt: function(f) {
|
||||||
var add = "", suf = '';
|
var add = "", suf = '';
|
||||||
if (f.seen == 1) add += "<i class='fa fa-check' title='"+_("Seen")+"'></i>";
|
if (f.seen == 1) add += "<i class='fa fa-check' title='"+_("Seen")+"'></i>";
|
||||||
if (f.message) {
|
if (f.message) {
|
||||||
|
@ -133,25 +133,5 @@ var banlist_init = function(token, my_boards, inMod) {
|
||||||
|
|
||||||
$(".banform").off("submit").submit();
|
$(".banform").off("submit").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (device_type == 'desktop') {
|
|
||||||
// Stick topbar
|
|
||||||
var stick_on = $(".banlist-opts").offset().top;
|
|
||||||
var state = true;
|
|
||||||
$(window).on("scroll resize", function() {
|
|
||||||
if ($(window).scrollTop() > stick_on && state == true) {
|
|
||||||
$("body").css("margin-top", $(".banlist-opts").height());
|
|
||||||
$(".banlist-opts").addClass("boardlist top").detach().prependTo("body");
|
|
||||||
$("#banlist tr:not(.row)").addClass("tblhead").detach().appendTo(".banlist-opts");
|
|
||||||
state = !state;
|
|
||||||
}
|
|
||||||
else if ($(window).scrollTop() < stick_on && state == false) {
|
|
||||||
$("body").css("margin-top", "auto");
|
|
||||||
$(".banlist-opts").removeClass("boardlist top").detach().prependTo(".banform");
|
|
||||||
$(".tblhead").detach().prependTo("#banlist");
|
|
||||||
state = !state;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,28 @@
|
||||||
.longtable {
|
.longtable {
|
||||||
display: block;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
display: table;
|
||||||
|
table-layout: fixed;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.longtable > tbody {
|
.longtable > tbody {
|
||||||
display: block;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
.longtable > tbody > tr {
|
.longtable > tbody > tr {
|
||||||
display: block;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
clear: left;
|
clear: left;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.longtable > tbody > tr > td {
|
.longtable > tbody > tr > td {
|
||||||
display: block;
|
display: table;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
float: left;
|
float: left;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
.longtable > tbody > tr > th {
|
.longtable > tbody > tr > th {
|
||||||
display: block;
|
*display: table;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
float: left;
|
float: left;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -28,4 +30,3 @@
|
||||||
.longtable > tbody > tr > th.sortable {
|
.longtable > tbody > tr > th.sortable {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue