Skip to content

Commit 9ec7201

Browse files
committed
Merge pull request #13 from wind13/wind13
Let the buf to be a integer not float.
2 parents 12fe223 + 1d5aa18 commit 9ec7201

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

Gemfile.lock

100755100644
Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ PATH
66
GEM
77
remote: https://rubygems.org/
88
specs:
9+
celluloid (0.15.2)
10+
timers (~> 1.1.0)
911
childprocess (0.3.9)
1012
ffi (~> 1.0, >= 1.0.11)
1113
coderay (1.0.9)
1214
coffee-script (2.2.0)
1315
coffee-script-source
1416
execjs
15-
coffee-script-source (1.6.2)
17+
coffee-script-source (1.7.0)
1618
diff-lcs (1.2.4)
17-
execjs (1.4.0)
18-
multi_json (~> 1.0)
19-
ffi (1.9.0)
19+
execjs (2.0.2)
20+
ffi (1.9.3)
2021
formatador (0.2.4)
2122
guard (1.8.0)
2223
formatador (>= 0.2.4)
@@ -43,23 +44,21 @@ GEM
4344
multi_json
4445
rainbow
4546
sprockets (~> 2)
46-
listen (1.1.6)
47+
listen (2.7.5)
48+
celluloid (>= 0.15.2)
4749
rb-fsevent (>= 0.9.3)
4850
rb-inotify (>= 0.9)
49-
rb-kqueue (>= 0.2)
5051
lumberjack (1.0.3)
5152
method_source (0.8.1)
52-
multi_json (1.7.6)
53+
multi_json (1.10.1)
5354
pry (0.9.12.2)
5455
coderay (~> 1.0.5)
5556
method_source (~> 0.8)
5657
slop (~> 3.4)
5758
rack (1.5.2)
5859
rainbow (1.1.4)
59-
rb-fsevent (0.9.3)
60-
rb-inotify (0.9.0)
61-
ffi (>= 0.5.0)
62-
rb-kqueue (0.2.0)
60+
rb-fsevent (0.9.4)
61+
rb-inotify (0.9.4)
6362
ffi (>= 0.5.0)
6463
rspec (2.13.0)
6564
rspec-core (~> 2.13.0)
@@ -83,6 +82,7 @@ GEM
8382
tilt (~> 1.1, != 1.3.0)
8483
thor (0.18.1)
8584
tilt (1.4.1)
85+
timers (1.1.0)
8686
websocket (1.0.7)
8787

8888
PLATFORMS
@@ -95,3 +95,6 @@ DEPENDENCIES
9595
jasmine-headless-webkit
9696
jquery-bootstrap-pagination!
9797
rb-fsevent
98+
99+
BUNDLED WITH
100+
1.11.2

src/jquery-bootstrap-pagination.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
# merge defaults with passed in options:
4949
@settings = $.extend(defaults, options)
50+
@settings.total_pages = Math.max(1, @settings.total_pages)
5051

5152
# add a click handler event to the view:
5253
if $(document).on
@@ -119,7 +120,7 @@
119120
# else if the current page is greater than the maximum display then
120121
# show pages on both side of the current page:
121122
else if current_page > max - 1
122-
buf = max / 2
123+
buf = Math.ceil(max / 2)
123124
pages.push page for page in [(current_page - buf)..(current_page + buf)]
124125
# else if the current page is less than or equal to the sub max then only
125126
# show from 2 to the max page.

0 commit comments

Comments
 (0)