Class: Browser::Window

Inherits:
Object
  • Object
show all
Includes:
Native
Defined in:
lib/opal/jquery/window.rb

Overview

Window instances are Native objects used to wrap native window instances.

Generally, you will want to use the top level Window instance, which wraps window from the main page.

Instance Method Summary collapse

Instance Method Details

#elementElement

Returns this Browser::Window instance wrapped as an Element. Useful for delegating jQuery events, which allows the use of window as target.


15
16
17
# File 'lib/opal/jquery/window.rb', line 15

def element
  @element ||= Element.find(`window`)
end

#off(*args, &block) ⇒ Object

See Also:


25
26
27
# File 'lib/opal/jquery/window.rb', line 25

def off(*args, &block)
  element.off(*args, &block)
end

#on(*args, &block) ⇒ Object

See Also:


20
21
22
# File 'lib/opal/jquery/window.rb', line 20

def on(*args, &block)
  element.on(*args, &block)
end

#trigger(*args) ⇒ Object

See Also:


30
31
32
# File 'lib/opal/jquery/window.rb', line 30

def trigger(*args)
  element.trigger(*args)
end