Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Seperated helper methods.

  • Loading branch information...
commit e2357c20727363c2a076da3fba5a5f7831781b60 1 parent fe64695
@maecro authored
Showing with 27 additions and 7 deletions.
  1. +27 −7 app/helpers/nether_helper.rb
View
34 app/helpers/nether_helper.rb
@@ -19,27 +19,47 @@ def nether(total_pages, url=nil, identifier=nil, container=nil)
javascript_tag("$('#{identifier}').pageless(#{opts.to_json});")
end
- # Creates a content area that can be paired with nether_sticky_footer
+ # Creates a wrapper that sticks nether sticky content in place.
#
# ==== Signatures
#
- # nether_sticky_body() do
+ # nether_sticky_wrap() do
# # ...
# end
#
- # nether_sticky_body wrap_options = {}, content_options = {}, do
+ # nether_sticky_wrap(wrap_options = {}) do
# # ...
# end
- def nether_sticky_body(wrap_options={}, content_options={}, &block)
+ def nether_sticky_wrap(wrap_options={}, content_options={}, &block)
if block_given?
wrap_options[:class] ||= "nether_wrap"
- content_options[:class] ||= "nether_content"
-
wrap_tag_options = tag_options(wrap_options)
+
+ "<div#{wrap_tag_options}>#{capture(&block)}</div>".html_safe
+ else
+ raise ArgumentError, "Missing block"
+ end
+ end
+
+ # Creates a content area that can be paired with nether_sticky_footer
+ #
+ # ==== Signatures
+ #
+ # nether_sticky_content() do
+ # # ...
+ # end
+ #
+ # nether_sticky_content(content_options = {}) do
+ # # ...
+ # end
+ def nether_sticky_content(content_options={}, &block)
+ if block_given?
+
+ content_options[:class] ||= "nether_content"
content_tag_options = tag_options(content_options)
- "<div#{wrap_tag_options}><div#{content_tag_options}>#{capture(&block)}</div></div>".html_safe
+ "<div#{content_tag_options}>#{capture(&block)}</div>".html_safe
else
raise ArgumentError, "Missing block"
end
Please sign in to comment.
Something went wrong with that request. Please try again.