lib/renderers/html/spatial.rb in atome-0.5.5.8.7 vs lib/renderers/html/spatial.rb in atome-0.5.5.9.1
- old
+ new
@@ -1,41 +1,39 @@
# frozen_string_literal: true
-new({ method: :top, type: :integer, renderer: :html }) do |params|
- # TODO: replace px with the unit specified by the user or sepcified by default by the system
- params="#{params}px" unless params.instance_of?(Symbol)
- html.style(:top, params)
-
+new({ method: :left, type: :integer, renderer: :html }) do |params|
+ unit = @unit[:left] || :px
+ js[:style][:left] = "#{params}#{unit}"
end
-new({ method: :top, type: :integer, renderer: :html, specific: :text }) do |params|
- html.style(:top, "#{params}px")
+new({ method: :top, type: :integer, renderer: :html }) do |params|
+ unit = @unit[:top] || :px
+ # alert unit
+ js[:style][:top] = "#{params}#{unit}"
end
-new({ method: :top, type: :integer, renderer: :html, specific: :shadow })
-
new({ method: :bottom, type: :integer, renderer: :html }) do |params|
- # TODO: replace px with the unit specified by the user or sepcified by default by the system
- params="#{params}px" unless params.instance_of?(Symbol)
- html.style(:bottom, params)
+ unit = @unit[:bottom] || :px
+ js[:style][:bottom] = "#{params}#{unit}"
end
-new({ method: :bottom, type: :integer, renderer: :html, specific: :text }) do |params|
- html.style(:bottom, params)
-end
-
new({ method: :right, type: :integer, renderer: :html }) do |params|
- # TODO: replace px with the unit specified by the user or sepcified by default by the system
- params="#{params}px" unless params.instance_of?(Symbol)
- html.style(:right, params)
-end
+ unit = @unit[:right] || :px
-new({ method: :left, type: :integer, renderer: :html }) do |params|
- # TODO: replace px with the unit specified by the user or sepcified by default by the system
- params="#{params}px" unless params.instance_of?(Symbol)
- html.style(:left, params)
+ 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|
+# unit = @unit[:left] || :px
+# html.style(:top, "#{params}#{unit}"
+# end
+#
+# new({ method: :bottom, type: :integer, renderer: :html, specific: :text }) do |params|
+# html.style(:bottom, "#{params}#{unit}")
+# end
+
new({ method: :left, type: :integer, specific: :color, renderer: :html })
new({ method: :left, type: :integer, renderer: :html, specific: :shadow })
new({ method: :top, type: :integer, specific: :color, renderer: :html })
@@ -44,15 +42,15 @@
html.transform(:rotate, params)
end
new({ method: :rotate, type: :integer, renderer: :html, specific: :paint })
-new({renderer: :html, method: :position }) do |params|
+new({ renderer: :html, method: :position }) do |params|
html.style("position", params)
end
-new({renderer: :html, method: :depth }) do |params|
+new({ renderer: :html, method: :depth }) do |params|
html.style("z-index", params)
end
new({ method: :organise, renderer: :html }) do |params|
html.style(:gridTemplateColumns, params)
@@ -64,8 +62,8 @@
new({ method: :display, renderer: :html }) do |params|
html.style(:display, params)
end
-new({renderer: :html, method: :center}) do |params|
+new({ renderer: :html, method: :center }) do |params|
html.center(params, attach)
end