Sha256: 5f75cc28b0ec131ece2cf995995794519100f86f4e60a119f9648500db9d7016

Contents?: true

Size: 519 Bytes

Versions: 1

Compression:

Stored size: 519 Bytes

Contents

require 'opal-jquery/constants'
require 'opal-jquery/element'

Document = Element.find(`document`)

class << Document
  `var $ = #{JQUERY_SELECTOR.to_n}` # cache $ for SPEED

  def ready?(&block)
    `$(#{ block })` if block
  end

  def title
    `document.title`
  end

  def title=(title)
    `document.title = #{title}`
  end

  def head
    Element.find(`document.head`)
  end

  def body
    Element.find(`document.body`)
  end
end

# TODO: this will be removed soon (here for compatibility)
$document = Document

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-jquery-0.3.0.beta1 opal/opal-jquery/document.rb