Class: UnderOs::UI::Input

Inherits:
View
  • Object
show all
Includes:
Editable
Defined in:
lib/under_os/ui/input.rb

Constant Summary

Constants included from Editable

Editable::KEYBOARDS

Constants included from Wrap

Wrap::INSTANCES_CACHE, Wrap::RAW_WRAPS_MAP, Wrap::WRAPS_TAGS_MAP

Instance Method Summary collapse

Methods included from Editable

#keyboard, #keyboard=, #placeholder, #placeholder=, #value, #value=

Methods inherited from View

#inspect

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, #hide, #id, #id=, #page, #show, #tagName, #toggle, #visible

Methods included from Styles

#addClass, #className, #className=, #classNames, #classNames=, #hasClass, #radioClass, #removeClass, #repaint, #style, #style=, #toggleClass

Methods included from Events

#emit, #off, #on, #on=

Methods included from Wrap

included

Constructor Details

#initialize(options = {}) ⇒ Input

Returns a new instance of Input.



6
7
8
9
10
11
12
13
14
15
# File 'lib/under_os/ui/input.rb', line 6

def initialize(options={})
  super

  # self.type        = options[:type]        if options[:type]
  self.value       = options[:value]       if options[:value]
  self.placeholder = options[:placeholder] if options[:placeholder]
  self.keyboard    = options[:keyboard]    if options[:keyboard]

  @_.delegate      = self
end

Instance Method Details

#hide_keyboardObject



37
38
39
# File 'lib/under_os/ui/input.rb', line 37

def hide_keyboard
  @_.resignFirstResponder
end

#textFieldShouldReturn(textField) ⇒ Object

def type=(type)

case type.to_sym
when :password then @_.secureTextEntry = true
end

end



32
33
34
35
# File 'lib/under_os/ui/input.rb', line 32

def textFieldShouldReturn(textField)
  hide_keyboard
  false
end