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