diff options
Diffstat (limited to 'lib/sidebars/menu.rb')
-rw-r--r-- | lib/sidebars/menu.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sidebars/menu.rb b/lib/sidebars/menu.rb index 03995362ff0..432cc6ebc8b 100644 --- a/lib/sidebars/menu.rb +++ b/lib/sidebars/menu.rb @@ -117,6 +117,15 @@ module Sidebars insert_element_after(@items, after_item, new_item) end + def replace_placeholder(item) + idx = @items.index { |e| e.item_id == item.item_id && e.is_a?(::Sidebars::NilMenuItem) } + if idx.nil? + add_item(item) + else + replace_element(@items, item.item_id, item) + end + end + override :container_html_options def container_html_options super.tap do |html_options| |