paginator: page number

main
psychobunny 10 years ago
parent 0d031af65f
commit 8392838bd2

@ -5,6 +5,7 @@
$(document).ready(function() {
setupSlideMenu();
setupEditedByIcon();
setupPaginator();
var env = utils.findBootstrapEnvironment();
@ -95,7 +96,7 @@ $(document).ready(function() {
function setupEditedByIcon() {
function activateEditedTooltips() {
$('[data-pid] [component="post/editor"]').each(function() {
var el = $(this);
var el = $(this), icon;
if (!el.attr('data-editor')) {
return;
@ -118,5 +119,16 @@ $(document).ready(function() {
$(window).on('action:posts.loaded', activateEditedTooltips);
}
function setupPaginator() {
function appendPageNumber(ev, data) {
var el = data.after ? data.after : data.before,
page = Math.ceil((el.attr('data-index') - 1) / config.postsPerPage);
el.append('<div class="page-number">' + page + '</div>');
}
$(window).on('action:posts.loading', appendPageNumber);
}
});

@ -1,2 +1,3 @@
@import "modules/taskbar";
@import "modules/alerts";
@import "modules/alerts";
@import "modules/paginator";

@ -0,0 +1,15 @@
.topic {
.page-number {
position: absolute;
bottom: 6px;
right: 100px;
background: rgb(219, 68, 55);
padding: 4px;
width: 26px;
height: 26px;
text-align: center;
border-radius: 50%;
color: white;
font-size: 11px;
}
}
Loading…
Cancel
Save