add form property to checkbox
parent
7d8c56e3f2
commit
eec62fade2
|
@ -61,7 +61,7 @@ class MechanizeCr::Form
|
|||
type = (html_node["type"] || "text").downcase
|
||||
case type
|
||||
when "checkbox"
|
||||
@checkboxes << MechanizeCr::FormContent::CheckBox.new(html_node)
|
||||
@checkboxes << MechanizeCr::FormContent::CheckBox.new(html_node, self)
|
||||
else
|
||||
@fields << MechanizeCr::FormContent::Field.new(html_node)
|
||||
end
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
class MechanizeCr::FormContent::CheckBox < MechanizeCr::FormContent::Field
|
||||
property :checked
|
||||
property :checked, :form
|
||||
|
||||
def initialize(node : Node | Myhtml::Node, value = nil)
|
||||
def initialize(node : Node | Myhtml::Node, form : MechanizeCr::Form)
|
||||
@checked = !!node["checked"]
|
||||
super(node, value)
|
||||
@form = form
|
||||
super(node)
|
||||
end
|
||||
|
||||
def check
|
||||
|
|
Loading…
Reference in New Issue