lib/page_up/pages.rb in page_up-0.0.9 vs lib/page_up/pages.rb in page_up-0.0.10
- old
+ new
@@ -43,10 +43,14 @@
rescue TypeError
default
end
def slice_start
- start = pages - ((page + 2 > pages) ? 4 : 2)
+ start = if page + 2 > pages
+ pages - 4
+ else
+ page - 2
+ end
start > 0 ? start : 1
end
def slice_end
if page + 2 > pages || pages < 5