Class: Ferro::Element::Button
- Inherits:
-
BaseElement
- Object
- BaseElement
- Ferro::Element::Button
- Defined in:
- opal/opal-ferro/elements/ferro_inline.js.rb
Overview
Creates a button (see form elements for ‘input type: button’). In the DOM creates a: <input type=‘button’>.
Constant Summary
Constants included from Ferro::Elementary
Ferro::Elementary::RESERVED_NAMES
Instance Attribute Summary
Attributes inherited from BaseElement
#children, #domtype, #element, #parent, #sym
Instance Method Summary collapse
-
#_after_create ⇒ Object
Internal method.
-
#_before_create ⇒ Object
Internal method.
-
#clicked ⇒ Object
Override this method to define what happens after element has been clicked.
Methods inherited from BaseElement
#add_state, #add_states, #classify_state, #component, #dom_id, #factory, #get_text, #html, #initialize, #option_replace, #remove_attribute, #root, #router, #set_attribute, #set_text, #state_active?, #toggle_state, #update_state, #value, #value=
Methods included from Ferro::Elementary
#_stylize, #add_child, #after_create, #before_create, #cascade, #create, #creation, #destroy, #each_child, #forget_children, #method_missing, #remove_child, #style, #symbolize
Constructor Details
This class inherits a constructor from Ferro::BaseElement
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ferro::Elementary
Instance Method Details
#_after_create ⇒ Object
Internal method.
160 161 162 163 |
# File 'opal/opal-ferro/elements/ferro_inline.js.rb', line 160 def _after_create `#{@element}.addEventListener("click",function(e){#{clicked};document.activeElement.blur()})` super end |
#_before_create ⇒ Object
Internal method.
155 156 157 |
# File 'opal/opal-ferro/elements/ferro_inline.js.rb', line 155 def _before_create @domtype = :button end |
#clicked ⇒ Object
Override this method to define what happens after element has been clicked.
167 |
# File 'opal/opal-ferro/elements/ferro_inline.js.rb', line 167 def clicked;end |