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
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
#get_oid, html_attr, #oid, #onclick_callback, #onclick_javascript, #onclick_update_callback, #onclick_update_self_callback, #ondblclick_callback
Methods inherited from Wee::Brush
Constructor Details
#initialize ⇒ CheckboxTag
Returns a new instance of CheckboxTag.
408 409 410 |
# File 'lib/wee/html_brushes.rb', line 408 def initialize super(HTML_TYPE) end |
Instance Method Details
#with ⇒ Object
414 415 416 417 418 419 420 421 422 423 424 |
# File 'lib/wee/html_brushes.rb', line 414 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 |