app/helpers/alchemy/admin/navigation_helper.rb in alchemy_cms-3.2.1 vs app/helpers/alchemy/admin/navigation_helper.rb in alchemy_cms-3.3.0.rc1
- old
+ new
@@ -1,12 +1,10 @@
module Alchemy
module Admin
-
# This module contains helper methods for rendering the admin navigation.
#
module NavigationHelper
-
# Renders one admin main navigation entry
#
# @param [Hash] alchemy_module
# The Hash representing a Alchemy module
#
@@ -201,15 +199,15 @@
# Returns true if the current controller and action is in a modules navigation definition.
#
def admin_mainnavi_active?(main_navigation)
main_navigation.stringify_keys!
# Has the given navigation entry a active sub navigation?
- has_active_entry?(module_sub_navigation(main_navigation)) or
+ has_active_entry?(module_sub_navigation(main_navigation)) ||
# Has the given navigation entry a active nested navigation?
- has_active_entry?(module_nested_navigation(main_navigation)) or
- # Is the navigation entry active?
- entry_active?(main_navigation)
+ has_active_entry?(module_nested_navigation(main_navigation)) ||
+ # Is the navigation entry active?
+ entry_active?(main_navigation)
end
# Returns true if the given entry's controller is current controller
#
def is_entry_controller_active?(entry)
@@ -230,9 +228,8 @@
# Alchemy module navigation entries.
#
def has_active_entry?(entries)
!entries.detect { |entry| entry_active?(entry) }.nil?
end
-
end
end
end