Class: MenuBar::AbstractItem
- Inherits:
-
AbstractContent
- Object
- AbstractContent
- MenuBar::AbstractItem
- Defined in:
- lib/menu_bar.rb
Direct Known Subclasses
Constant Summary
Constants included from EasyMenu::Helpers
EasyMenu::Helpers::HTML_OPTIONS
Instance Attribute Summary
Attributes inherited from AbstractContent
Instance Method Summary collapse
-
#disable_when(observable_dom_element, dom_event, js_condition, click_blocker_html_options = {}) ⇒ Object
Set the button up to disable when a particular DOM Event occurs.
- #disabled(*args) ⇒ Object
- #selected(condition = :unset) ⇒ Object
Methods inherited from AbstractContent
#empty?, #initialize, #right_aligned?, #to_s
Methods included from EasyMenu::Helpers
#config_name, #css_class, #html_option_keys, #merge_class, #wrapper_element
Constructor Details
This class inherits a constructor from MenuBar::AbstractContent
Instance Method Details
#disable_when(observable_dom_element, dom_event, js_condition, click_blocker_html_options = {}) ⇒ Object
Set the button up to disable when a particular DOM Event occurs
205 206 207 208 209 |
# File 'lib/menu_bar.rb', line 205 def disable_when(observable_dom_element, dom_event, js_condition, = {}) @options[:disable_when] = {:element => observable_dom_element, :event => dom_event, :condition => js_condition} @click_blocker_html_options = return self end |
#disabled(*args) ⇒ Object
197 198 199 200 201 202 |
# File 'lib/menu_bar.rb', line 197 def disabled(*args) @click_blocker_html_options = args. @options[:disabled] = args.present? ? args.first : true return self end |
#selected(condition = :unset) ⇒ Object
191 192 193 194 195 |
# File 'lib/menu_bar.rb', line 191 def selected(condition = :unset) @options[:selected] = (condition == :unset ? true : condition) return self end |