Skip to content

Commit

Permalink
Method cleanup and performance enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Clewell committed Mar 19, 2013
1 parent 02434f7 commit 049feb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/jqueryui_widgets/menus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def search_for(*labels)
def loop_through_menu_items(labels)
menu_container = self
labels.each do |label|
menu_container.each do |list_item|
menu_items_for(menu_container).each do |list_item|
if list_item.text.slice!(label) == label
yield list_item
menu_container = list_item.unordered_list_element
Expand All @@ -58,4 +58,8 @@ def loop_through_menu_items(labels)
end
end
end

def menu_items_for(menu)
menu.list_item_elements
end
end

0 comments on commit 049feb8

Please sign in to comment.