lib/renderers/html/spatial.rb in atome-0.5.5.9.1 vs lib/renderers/html/spatial.rb in atome-0.5.6.0.2
- old
+ new
@@ -1,25 +1,24 @@
# frozen_string_literal: true
new({ method: :left, type: :integer, renderer: :html }) do |params|
- unit = @unit[:left] || :px
+ unit = @unit[:left] || :px if params.is_a? Numeric
js[:style][:left] = "#{params}#{unit}"
end
new({ method: :top, type: :integer, renderer: :html }) do |params|
- unit = @unit[:top] || :px
- # alert unit
+ unit = @unit[:top] || :px if params.is_a? Numeric
js[:style][:top] = "#{params}#{unit}"
end
new({ method: :bottom, type: :integer, renderer: :html }) do |params|
- unit = @unit[:bottom] || :px
- js[:style][:bottom] = "#{params}#{unit}"
+ unit = @unit[:bottom] || :px if params.is_a? Numeric
+ js[:style][:bottom] = "#{params}#{unit}"
end
new({ method: :right, type: :integer, renderer: :html }) do |params|
- unit = @unit[:right] || :px
+ unit = @unit[:right] || :px if params.is_a? Numeric
- js[:style][:right] = "#{params}#{unit}"
+ js[:style][:right] = "#{params}#{unit}"
end
new({ method: :top, type: :integer, renderer: :html, specific: :shadow })
# new({ method: :top, type: :integer, renderer: :html, specific: :text }) do |params|