Class: TwitterBootstrapMarkup::ExtendedInput

Inherits:
Tag
  • Object
show all
Defined in:
lib/twitter_bootstrap_markup/extended_input.rb

Constant Summary

Constants included from Popover

Popover::POSITIONS

Constants included from Tooltip

Tooltip::POSITIONS

Instance Attribute Summary

Attributes inherited from Tag

#attributes, #children, #name

Instance Method Summary collapse

Methods inherited from Tag

#append, block, inline, #prepend, #to_s

Methods included from SidePosition

#pull_left, #pull_right

Methods included from Popover

#popover

Methods included from Tooltip

#tooltip

Constructor Details

#initialize(attributes = {}, &block) ⇒ ExtendedInput

Returns a new instance of ExtendedInput.



4
5
6
7
8
# File 'lib/twitter_bootstrap_markup/extended_input.rb', line 4

def initialize(attributes={}, &block)
  super(:div, attributes, &block)
  attributes.append!(:class, 'input-prepend') unless children.first.is_a?(Input) && children.first.attributes[:type] == :text
  attributes.append!(:class, 'input-append') unless children.last.is_a?(Input) && children.last.attributes[:type] == :text
end