1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00
This commit is contained in:
Akira Matsuda 2017-06-06 17:27:22 +09:00
parent 967f3c6b98
commit 4efe5fd2bd

View file

@ -6,11 +6,8 @@ module Kaminari
module Helpers module Helpers
# The main container tag # The main container tag
class Paginator < Tag class Paginator < Tag
def initialize(template, window: nil, outer_window: nil, left: nil, right: nil, inner_window: nil, **options) #:nodoc: def initialize(template, window: nil, outer_window: Kaminari.config.outer_window, left: Kaminari.config.left, right: Kaminari.config.right, inner_window: Kaminari.config.window, **options) #:nodoc:
outer_window ||= Kaminari.config.outer_window @window_options = {window: window || inner_window, left: left.zero? ? outer_window : left, right: right.zero? ? outer_window : right}
left ||= Kaminari.config.left
right ||= Kaminari.config.right
@window_options = {window: window || inner_window || Kaminari.config.window, left: left.zero? ? outer_window : left, right: right.zero? ? outer_window : right}
@template, @options, @theme, @views_prefix, @last = template, options, options[:theme], options[:views_prefix], nil @template, @options, @theme, @views_prefix, @last = template, options, options[:theme], options[:views_prefix], nil
@window_options.merge! @options @window_options.merge! @options