Module: DOM::Document
- Extended by:
- SingleForwardable
- Defined in:
- opal/fron/dom/document.rb
Overview
This module is a wrapper for the native document object.
Class Method Summary collapse
-
.active_element ⇒ DOM::Element
Returns the active element.
-
.body ⇒ DOM::Element
Returns the body element.
- .doc ⇒ Object
-
.head ⇒ DOM::Element
Returns the head element.
-
.title ⇒ String
Returns the documents title.
-
.title=(value) ⇒ Object
Sets the documents title with the given value.
Class Method Details
.active_element ⇒ DOM::Element
Returns the active element
11 12 13 |
# File 'opal/fron/dom/document.rb', line 11 def self.active_element doc.find ':focus' end |
.body ⇒ DOM::Element
Returns the body element
29 30 31 |
# File 'opal/fron/dom/document.rb', line 29 def self.body @body ||= find 'body' end |
.doc ⇒ Object
15 16 17 |
# File 'opal/fron/dom/document.rb', line 15 def self.doc DOM::Element.new `document` end |
.head ⇒ DOM::Element
Returns the head element
22 23 24 |
# File 'opal/fron/dom/document.rb', line 22 def self.head @head ||= find 'head' end |
.title ⇒ String
Returns the documents title
36 37 38 |
# File 'opal/fron/dom/document.rb', line 36 def self.title `document.title` end |
.title=(value) ⇒ Object
Sets the documents title with the given value
43 44 45 |
# File 'opal/fron/dom/document.rb', line 43 def self.title=(value) `document.title = #{value}` end |