Skip to content

Commit

Permalink
Formatted pagination links to make styling easier
Browse files Browse the repository at this point in the history
  • Loading branch information
JangoSteve committed Jun 19, 2012
1 parent cccd78b commit 59b0cf2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions jquery.dynatable.js
Expand Up @@ -679,7 +679,7 @@
var breakIndex = $.inArray(i, breaks),
nextBreak = breaks[breakIndex + 1];
if (breakIndex > 0 && i !== 1 && nextBreak && nextBreak > (i + 1)) {
var $ellip = $('<span>&hellip;</span>');
var $ellip = $('<span class="dynatable-page-break">&hellip;</span>');
$link = breakIndex < 2 ? $link.before($ellip) : $link.after($ellip);
}

Expand All @@ -688,7 +688,7 @@
if (settings.inputs.paginationPrev && i === 1) {
var $prevLink = $('<a></a>',{
html: settings.inputs.paginationPrev,
'class': pageLinkClass,
'class': pageLinkClass + ' dynatable-page-prev',
'data-dynatable-page': page - 1
});
if (page === 1) { $prevLink.addClass(activePageClass); }
Expand All @@ -697,14 +697,18 @@
if (settings.inputs.paginationNext && i === pages) {
var $nextLink = $('<a></a>',{
html: settings.inputs.paginationNext,
'class': pageLinkClass,
'class': pageLinkClass + ' dynatable-page-next',
'data-dynatable-page': page + 1
});
if (page === pages) { $nextLink.addClass(activePageClass); }
$link = $link.after($nextLink);
}

$pageLinks.append($link.wrap('<li></li>'));
$link.each( function() {
$pageLinks.append( $('<li />', {
html: this
}) );
});
}

// only bind page handler to non-active pages
Expand Down

0 comments on commit 59b0cf2

Please sign in to comment.