Class: UnderOs::UI::Locker
Constant Summary
Constants included from Wrap
Wrap::INSTANCES_CACHE, Wrap::RAW_WRAPS_MAP, Wrap::WRAPS_TAGS_MAP
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#spinner ⇒ Object
readonly
Returns the value of attribute spinner.
Instance Method Summary collapse
- #hide ⇒ Object
-
#initialize(options = {}) ⇒ Locker
constructor
A new instance of Locker.
- #show ⇒ Object
- #show_for(&block) ⇒ Object
- #text ⇒ Object
- #text=(text) ⇒ Object
Methods inherited from View
Methods included from Manipulation
#append, #clear, #insert, #insertTo, #prepend, #remove
Methods included from Traversing
#children, #empty?, #find, #first, #matches, #parent, #siblings
Methods included from Dimensions
#position, #position=, #size, #size=
Methods included from Animation
#animate, #fade_in, #fade_out, #highlight
Methods included from Commons
#data, #data=, #hidden, #id, #id=, #page, #tagName, #toggle, #visible
Methods included from Styles
#addClass, #className, #className=, #classNames, #classNames=, #hasClass, #radioClass, #removeClass, #repaint, #style, #style=, #toggleClass
Methods included from Events
Methods included from Wrap
Constructor Details
#initialize(options = {}) ⇒ Locker
Returns a new instance of Locker.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/under_os/ui/locker.rb', line 6 def initialize(={}) super @dialog = UnderOs::UI::View.new(class: 'locker-dialog') @spinner = UnderOs::UI::Spinner.new @label = UnderOs::UI::Label.new(text: [:text] || '') append @dialog.append(@spinner, @label) addClass 'with-label' if [:text] end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
4 5 6 |
# File 'lib/under_os/ui/locker.rb', line 4 def label @label end |
#spinner ⇒ Object (readonly)
Returns the value of attribute spinner.
4 5 6 |
# File 'lib/under_os/ui/locker.rb', line 4 def spinner @spinner end |
Instance Method Details
#hide ⇒ Object
23 24 25 |
# File 'lib/under_os/ui/locker.rb', line 23 def hide remove end |
#show ⇒ Object
18 19 20 21 |
# File 'lib/under_os/ui/locker.rb', line 18 def show insertTo(UnderOs::App.history.current_page.view) if ! parent repaint end |
#show_for(&block) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/under_os/ui/locker.rb', line 35 def show_for(&block) show 1.ms.later do block.call 1.ms.later { hide } end end |
#text ⇒ Object
27 28 29 |
# File 'lib/under_os/ui/locker.rb', line 27 def text @label.text end |
#text=(text) ⇒ Object
31 32 33 |
# File 'lib/under_os/ui/locker.rb', line 31 def text=(text) @label.text = text end |