lib/ajax_pagination.rb in ajax_pagination-0.2.0 vs lib/ajax_pagination.rb in ajax_pagination-0.3.0
- old
+ new
@@ -10,9 +10,19 @@
# whether javascript warnings are on, these present themselves as alerts
mattr_accessor :warnings
@@warnings = nil # if nil, uses default, which is true only in development mode
+ # intercepts any AJAX Pagination 302 redirects, and turns them into Status 200 OK, with a Location: header. AJAX code can manually perform the redirection.
+ # can be disabled in the initializer
+ mattr_accessor :redirect_after_filter
+ @@redirect_after_filter = true
+
+ # when changing pages, AJAX Pagination scrolls to ensure the page sees the top of the changing section, plus an additional margin in pixels
+ # to turn this feature off, set scroll_margin to '-Infinity'
+ mattr_accessor :scroll_margin
+ @@scroll_margin = 20
+
# run rails generate ajax_pagination:install to create a default initializer with configuration values
def self.config
yield self
end
end