lib/atome/genesis/atome.rb in atome-0.5.6.3.6 vs lib/atome/genesis/atome.rb in atome-0.5.6.3.9
- old
+ new
@@ -1,6 +1,21 @@
# frozen_string_literal: true
-new({ atome: :color, type: :hash })
+new({ atome: :color, type: :hash }) do |params|
+ # # TODO : hack must call it properly thru renderer
+ # if params[:affect]
+ # params[:affect].each do |affected|
+ # grab(affected).html.reset_background
+ # end
+ # end
+
+end
+
+# new ({post: :color}) do |params|
+# # # TODO : hack must call it properly thru renderer
+# # params[:affect].each do |affected|
+# # grab(affected).html.reset_background
+# # end
+# end
new({ sanitizer: :color }) do |params|
params = create_color_hash(params) unless params.instance_of? Hash
# the condition below is to prevent the creation of multiple unwanted colors with same property and no ID specified
unless params[:id]
uniq_value = "#{params[:red].to_s.sub('.', '_')}_#{params[:green].to_s.sub('.', '_')}_#{params[:blue].to_s.sub('.', '_')}_#{params[:alpha].to_s.sub('.', '_')}_#{params[:left].to_s.sub('.', '_')}_#{params[:top].to_s.sub('.', '_')}_#{params[:diffusion].to_s.sub('.', '_')}"