Showing
2 changed files
with
10 additions
and
5 deletions
| ... | ... | @@ -79,13 +79,18 @@ module Kanjai |
| 79 | 79 | subpart = page_template.template_parts.where(code: page_content.type_content).first |
| 80 | 80 | if subpart |
| 81 | 81 | markers_position = {} |
| 82 | + | |
| 83 | + names_array = [] | |
| 82 | 84 | |
| 83 | - (subpart.conditions || []).sort{|a,b| a["name"] <=> b["name"] }.each_with_index do |item, index| | |
| 84 | - markers_position[item["name"]] = index | |
| 85 | + (subpart.conditions || []).each do |item| | |
| 86 | + names_array << item["name"] | |
| 87 | + end | |
| 88 | + subpart.field_options.each do |item| | |
| 89 | + names_array << item[:name] | |
| 85 | 90 | end |
| 86 | 91 | |
| 87 | - subpart.field_options.sort_by{|item| item[:itemName].to_s }.each_with_index do |item, index| | |
| 88 | - markers_position[item[:name]] = index + 100 | |
| 92 | + names_array.uniq.each_with_index do |name, index| | |
| 93 | + markers_position[name] = index | |
| 89 | 94 | end |
| 90 | 95 | |
| 91 | 96 | ... | ... |