Class: Wee::Brush::CheckboxTag
- Inherits:
-
InputTag
- Object
- Wee::Brush
- GenericTagBrush
- GenericSingleTagBrush
- InputTag
- Wee::Brush::CheckboxTag
- Defined in:
- lib/wee/html_brushes.rb
Constant Summary collapse
- HTML_TYPE =
'checkbox'.freeze
Constants inherited from InputTag
Constants inherited from GenericTagBrush
Instance Attribute Summary
Attributes inherited from Wee::Brush
Instance Method Summary collapse
-
#__callback ⇒ Object
do nothing.
-
#initialize ⇒ CheckboxTag
constructor
A new instance of CheckboxTag.
- #with ⇒ Object
Methods included from CallbackMixin
#call, #callback, #callback_method
Methods inherited from GenericSingleTagBrush
Methods inherited from GenericTagBrush
#callback_on, #get_oid, html_attr, #javascript_on, #oid, #onclick_callback, #onclick_javascript, #ondblclick_callback, #update_component_on, #update_on
Methods inherited from Wee::Brush
Constructor Details
#initialize ⇒ CheckboxTag
Returns a new instance of CheckboxTag.
455 456 457 |
# File 'lib/wee/html_brushes.rb', line 455 def initialize super(HTML_TYPE) end |
Instance Method Details
#with ⇒ Object
461 462 463 464 465 466 467 468 469 470 471 |
# File 'lib/wee/html_brushes.rb', line 461 def with if @callback n = @canvas.register_callback(:input, proc {|input| @callback.call(input.send(input.kind_of?(Array) ? :include? : :==, '1')) }) @document.single_tag('input', :type => 'hidden', :name => n, :value => '0') name(n) value('1') end super end |