Sha256: 11fe0283b6a635102c409c8243148301c0e42dc40095483cb9b0249c6a320c99

Contents?: true

Size: 558 Bytes

Versions: 5

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

# for browser rendering
module BrowserHelper
  def self.browser_document
    # Work because of the patched version of opal-browser(0.39)
    Browser.window
  end

  def self.browser_attach_div(parents, html_object, _atome)
    html_object.append_to(browser_document[parents])
  end

  def self.browser_attach_style(parents, _html_object, atome)
    browser_document[parents].add_class(atome[:id])
  end

  def self.value_parse(value)
    if value.instance_of?(String)
      value
    else
      "#{value}px"
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
atome-0.5.3.8.1 lib/atome/renderers/browser/helpers/browser_helper.rb
atome-0.5.3.8.0 lib/atome/renderers/browser/helpers/browser_helper.rb
atome-0.5.3.7.8 lib/atome/renderers/browser/helpers/browser_helper.rb
atome-0.5.3.7.3 lib/atome/renderers/browser/helpers/browser_helper.rb
atome-0.5.3.7.2 lib/atome/renderers/browser/helpers/browser_helper.rb