lib/molecules/intuition/utilities.rb in atome-0.5.7.4.3 vs lib/molecules/intuition/utilities.rb in atome-0.5.7.4.6
- old
+ new
@@ -503,11 +503,10 @@
main_app.instance_variable_set('@pages', {})
main_app.role(:application)
menu = buttons({
id: "#{id_f}_menu",
- # left: 66,
depth: 9999,
attach: id_f,
inactive: { text: { color: :gray }, width: 66, height: 12, spacing: 3, disposition: :horizontal,
color: :orange, margin: { left: 33, top: 12 } },
active: { text: { color: :white, shadow: {} }, color: :blue, shadow: {} },
@@ -599,27 +598,18 @@
new_page = main_page.box({ width: '100%', height: '100%', top: 0, left: 0, id: page_id })
# now looking for associated blocks
blocks_found = params[:blocks]
@prev_bloc_height = 0
- blocks_found&.each do |bloc_id, bloc_content|
+ blocks_found&.each do |bloc_id, bloc_content|
new_bloc = new_page.box({ id: bloc_id, role: :block, width: '100%', height: 99, top: spacing + @prev_bloc_height, bottom: 0, left: 0, right: 0, spacing: spacing })
-
new_bloc.define_singleton_method(:subs) do |sub_params|
- @prev_sub_width = 0
- sub_params.each do |sub_id, sub_content|
- sub_created = new_bloc.box({ id: sub_id, height: '100%', left: @prev_sub_width })
- sub_created.set(sub_content)
- @prev_sub_width = @prev_sub_width + sub_created.to_px(:width) + spacing
- sub_created.width(sub_created.to_percent(:width))
- sub_created.left(sub_created.to_percent(:left))
- end
+ new_bloc.sub_block(sub_params, 3)
end
new_bloc.set(bloc_content)
-
@prev_bloc_height = @prev_bloc_height + new_bloc.height + spacing
end
keys_to_exclude = [:blocks]
particles_to_apply = params.reject { |key, _| keys_to_exclude.include?(key) }
@@ -714,7 +704,6 @@
label = part_f[:text]
code = part_f[:code]
main.create_new_button(item_id, index, label, code)
end
main
-
end
\ No newline at end of file