lib/atome/genesis/generators/spatial.rb in atome-0.5.5.8.7 vs lib/atome/genesis/generators/spatial.rb in atome-0.5.5.9.1

- old
+ new

@@ -1,33 +1,45 @@ # frozen_string_literal: true -new({ particle: :left, type: :integer }) -new({ particle: :right, type: :integer }) -new({ particle: :top, type: :integer }) -new({ particle: :bottom, type: :integer }) +# new ({particle: :left}) do |params| +# {value: params, unit: :px} unless params.instance_of? Hash +# end +# new({ particle: :right, type: :integer })do |params| +# {value: params, unit: :px} unless params.instance_of? Hash +# end +# new({ particle: :top, type: :integer })do |params| +# {value: params, unit: :px} unless params.instance_of? Hash +# +# end +# new({ particle: :bottom, type: :integer })do |params| +# {value: params, unit: :px} unless params.instance_of? Hash +# end + +new ({particle: :left}) +new ({particle: :right}) +new ({particle: :top}) +new ({particle: :bottom}) + + new({ particle: :rotate, type: :integer }) new({ particle: :direction, type: :string }) new({ particle: :center, type: :string}) new({particle: :depth, type: :integer}) new({ particle: :position }) new({ particle: :organise }) new({ particle: :spacing }) new({ particle: :display }) do |params| - unless params.instance_of? Hash - params = { mode: params } - end + params = { mode: params } unless params.instance_of? Hash params end new({ particle: :layout }) do |params| mode_found = params.delete(:mode) || :list elements_style = params.delete(:element) || {} # now we get the list of the atome to layout atomes_to_organise = [] - if type == :group - atomes_to_organise = collect - end + atomes_to_organise = collect if type == :group # if params[:listing] is specified group collection is override atomes_to_organise = params[:listing] if params[:listing] if mode_found == :default # the user want to revert the layout to the default atomes_to_organise.each do |atome_id_to_organise| @@ -54,12 +66,10 @@ params[:id] = id_found container_class = id_found end container.remove({ category: :atome }) container.category(:matrix) - if mode_found == :list - params[:organise] = '1fr' - end + params[:organise] = '1fr' if mode_found == :list params.each do |particle, value| container.send(particle, value) end # now we add user wanted particles atomes_to_organise.each do |atome_id_to_organise|