Sha256: d8273faedba4b94b68d4f0b6ebed5662d72453e2c2bdc0e965f1859feffaded6

Contents?: true

Size: 643 Bytes

Versions: 2

Compression:

Stored size: 643 Bytes

Contents

require 'glimmer/opal/element_proxy'

module Glimmer
  module Opal
    class DivProxy < ElementProxy
      attr_reader :layout
      
      def initialize(parent, args)
        super(parent, args)
        @layout = GridLayoutProxy.new(self, [])
      end
      
      def redraw
        super()
        @children.each do |child|
          add_child(child) # TODO think of impact of this on performance, and of other alternatives
        end
      end
      
      def dom
        div_id = id
        div_style = css
        @dom ||= DOM {
          div(id: div_id, class: 'grid-layout', style: div_style)
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
glimmer-dsl-opal-0.0.9 lib/glimmer/opal/div_proxy.rb
glimmer-dsl-opal-0.0.8 lib/glimmer/opal/div_proxy.rb