lib/atome/genesis/particles/utility.rb in atome-0.5.7.0.3 vs lib/atome/genesis/particles/utility.rb in atome-0.5.7.0.4
- old
+ new
@@ -23,21 +23,32 @@
grab(atome_id).touch(:remove)
Universe.delete(atome_id)
end
new({ particle: :delete, category: :utility, type: :boolean, render: false }) do |params|
+
if params == true
# We use the tag persistent to exclude color of system object and other default colors
unless @tag && (@tag[:persistent] || @tag[:system])
# now we detach the atome from it's parent
# now we init rendering
render(:delete, params)
# the machine delete the current atome from the universe
id_found = @id.to_sym
- parent_found = grab(@attach)
- parent_found.attached.delete(id_found)
- Universe.delete(@aid)
+ if @attach
+ parent_found = grab(@attach)
+ parent_found.attached.delete(id_found)
+ end
+ if @affect
+ @affect.each do |affected_atome|
+ affected_found = grab(affected_atome)
+ affected_found.apply.delete(id_found)
+ affected_found.refresh
+ end
+ end
+
+ # Universe.delete(@aid)
end
elsif params.instance_of? Hash
if params[:recursive]
unless grab(@id).tag && (grab(@id).tag[:persistent] || grab(@id).tag[:system])
@@ -62,10 +73,11 @@
else
# alert grab(params).delete(true)
send(params, 0) unless params == :id
end
end
+
new({ particle: :clear, category: :utility, type: :boolean })
new({ post: :clear }) do
attached_found = []
attached.each do |attached_id_found|
@@ -252,10 +264,9 @@
@tick[val]
end
new({ particle: :storage, category: :utility, type: :hash })
new({ particle: :state, category: :utility, type: :symbol })
-
new({ particle: :record, category: :utility, type: :hash })
new({ particle: :preview, category: :utility, type: :hash })