Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for issue#17
  • Loading branch information
Eugene Simakin committed Sep 9, 2014
1 parent 604459e commit 85d858f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -180,7 +180,7 @@ <h3>

</section>

<aside id="sidebar">
<aside id="sidebar" class="hidden-xs">
<div id="navigation" data-spy="affix" data-offset-top="200">
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="#intro">Intro</a></li>
Expand Down
10 changes: 8 additions & 2 deletions js/jquery.twbsPagination.js
Expand Up @@ -23,8 +23,14 @@
throw new Error('Start page option is incorrect');
}

if (this.options.totalPages <= 0) {
throw new Error('Total pages option cannot be less 1 (one)!');
this.options.totalPages = parseInt(this.options.totalPages);
if (isNaN(this.options.totalPages)) {
throw new Error('Total pages option is not correct!');
}

this.options.visiblePages = parseInt(this.options.visiblePages);
if (isNaN(this.options.visiblePages)) {
throw new Error('Visible pages option is not correct!');
}

if (this.options.totalPages < this.options.visiblePages) {
Expand Down
4 changes: 2 additions & 2 deletions js/main.js
@@ -1,7 +1,7 @@
$(document).ready(function () {
$('#pagination-demo').twbsPagination({
totalPages: 35,
visiblePages: 7,
totalPages: "35",
visiblePages: "10",
onPageClick: function (event, page) {
$('#page-content').text('Page ' + page);
}
Expand Down

0 comments on commit 85d858f

Please sign in to comment.