lib/simple_navigation/item_container.rb in simple-navigation-4.0.5 vs lib/simple_navigation/item_container.rb in simple-navigation-4.1.0
- old
+ new
@@ -14,18 +14,20 @@
def initialize(level = 1) #:nodoc:
@level = level
@items ||= []
@renderer = SimpleNavigation.config.renderer
@auto_highlight = true
+ @dom_attributes = {}
end
def dom_attributes
# backward compability for #dom_id and #dom_class
dom_id_and_class = {
id: dom_id,
class: dom_class
}.reject { |_, v| v.nil? }
- (@dom_attributes || {}).merge(dom_id_and_class)
+
+ @dom_attributes.merge(dom_id_and_class)
end
# Creates a new navigation item.
#
# The <tt>key</tt> is a symbol which uniquely defines your navigation item