Files

JqmobileHelpers::ButtonsHelper

JqmobileHelpers Buttons Helper

Provides a set of helper methods for jquery-mobile buttons

Public Instance Methods

back_split_button(name, link, options ={} ) click to toggle source
BACK-SPLIT-BUTTON ===========================================================

In cases where there is more than one possible action per list item, a split button can be used to offer two independently clickable items — the list item and a small arrow icon in the far right The framework will add a vertical divider line and sets the title attribute of the link to the text the link for accessibility. It is similar for the Split-Button List.

Options

  # => 'data-inset' => 'true' (Default data-inset is set to true)
  # => 'data-theme' => 'c' (Default data-theme is set to c)
     

Examples

  <%= back_split_button "Back", posts_path %>
  # => <div data-role="content"><a href="index.html" data-role="button" data-rel="back">Back</a></div>  
     # File lib/jqmobile_helpers/buttons_helper.rb, line 579
579:     def back_split_button(name, link, options ={} )
580:       html_options = options.stringify_keys!
581:       default_options = {'data-role' => "button", 'data-rel' => "back"}  
582:       content_tag(:a, name, {:href => link}.merge(default_options))
583:     end
group_button(content, options = {}) click to toggle source

Grouped Button

Examples

  group_button("
      #{home_button_link('home', buttons_path, 'data-iconpos' => 'right')}
      #{refresh_button_link 'refresh', buttons_path}
       ")
  # => <div data-role="controlgroup">
         <a data-icon="home" data-iconpos="right" data-role="button" href="/buttons">home</a>
         <a data-icon="refresh" data-role="button" href="/buttons">refresh</a>
       </div>

  group_button("
      #{home_button_link('home', buttons_path, 'data-iconpos' => 'right')}
      #{refresh_button_link 'refresh', buttons_path}, {'data-type' => 'horizontal'}
       ")
  # => <div data-role="controlgroup" data-type="horizontal" >
         <a data-icon="home" data-iconpos="right" data-role="button" href="/buttons">home</a>
         <a data-icon="refresh" data-role="button" href="/buttons">refresh</a>
       </div>
     # File lib/jqmobile_helpers/buttons_helper.rb, line 605
605:     def group_button(content, options = {})
606: 
607:       html_options = options.stringify_keys!
608:       default_options = {'data-role'=> "controlgroup"}
609: 
610:       if html_options.has_key?('data-type')
611:         default_options = default_options.merge({'data-type' => html_options['data-type']})
612:       end
613: 
614:       content_tag(:div, content, default_options, false)
615:     end
inline_button(content) click to toggle source

Inline Buttons

Examples

  inline_button("
      #{home_button_link('home', buttons_path, 'data-iconpos' => 'right')}
      #{refresh_button_link 'refresh', buttons_path}
       ")
  # => <div data-inline="true" data-role="controlgroup" data-type="horizontal">
         <a data-icon="home" data-iconpos="right" data-role="button" href="/buttons">home</a>
         <a data-icon="refresh" data-role="button" href="/buttons">refresh</a>
       </div>
     # File lib/jqmobile_helpers/buttons_helper.rb, line 630
630:     def inline_button(content)
631: 
632:       default_options = {'data-inline'=> "true", 'data-role'=> "controlgroup", 'data-type' => "horizontal"}
633: 
634:       content_tag(:div, content, default_options, false)
635:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.