Class: Browser::Window::Size
Overview
Allows access and manipulation of the Browser::Window size.
Instance Attribute Summary collapse
-
#width ⇒ Integer
The width of the window.
Instance Method Summary collapse
Instance Attribute Details
#width ⇒ Integer
Returns the width of the window.
|
# File 'opal/browser/window/size.rb', line 26
|
Instance Method Details
#height ⇒ Object
37 38 39 |
# File 'opal/browser/window/size.rb', line 37 def height `#@native.outerHeight` end |
#height=(value) ⇒ Object
54 55 56 |
# File 'opal/browser/window/size.rb', line 54 def height=(value) set(height: value) end |
#set(*args) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'opal/browser/window/size.rb', line 11 def set(*args) if Hash === args.first width, height = args.first.values_at(:width, :height) else width, height = args end width ||= self.width height ||= self.height `#@native.resizeTo(#{width}, #{height})` self end |