Fix site menu widget cannot only display child pages bug.
This commit is contained in:
parent
bf2edc94c2
commit
9e42030f14
|
@ -64,11 +64,9 @@ class SiteMenuWidgetsController < ApplicationController
|
|||
else
|
||||
@pages = page.parent_page.sorted_published_child_pages
|
||||
if subpart.methods.include? 'select_options'.to_sym
|
||||
OrbitWidget.all.select{|tmp| tmp.key.to_s=='site_menu_widget'}.each do |orbit_widget|
|
||||
@show_options = orbit_widget.show_options rescue nil
|
||||
end
|
||||
@show_options = OrbitWidget.where(:key=>"site_menu_widget").select{|orbit_widget| (orbit_widget.methods.include?(:show_options) rescue false) }.first.show_options rescue nil
|
||||
subpart.select_options.each do |select_option|
|
||||
if !(@show_options.nil?) && select_option.field_name == @show_options.keys.first.to_s
|
||||
if (!@show_options.nil?) && (select_option.field_name == @show_options.keys.first.to_s)
|
||||
value = YAML.load(select_option.value)
|
||||
if value[I18n.locale] == t('site_menu.yes')
|
||||
if page.parent_page.parent_page == Page.root
|
||||
|
@ -88,10 +86,13 @@ class SiteMenuWidgetsController < ApplicationController
|
|||
if value[I18n.locale] == t('site_menu.yes')
|
||||
@expand_layer = true
|
||||
@expand_next_layer = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if @expand_next_layer && !@expand_current_layer
|
||||
@pages = page.child_page
|
||||
end
|
||||
end
|
||||
@ul_index=[]
|
||||
@count = -1
|
||||
|
|
Loading…
Reference in New Issue