Sha256: edc62dd1181eebecb9789d5e5983fb45168b83e9833d44dd268d4e67622e2e21

Contents?: true

Size: 1.44 KB

Versions: 10

Compression:

Stored size: 1.44 KB

Contents

:css
  #batch-action-dropdown {
    display: none;
  }

%form{ method: 'post', id: 'batch-action-form' }
  = hidden_field_tag :authenticity_token, form_authenticity_token
.dropdown.batch-action-dropdown
  %button.btn.btn-default.dropdown-toggle{"aria-expanded" => "true", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button", id: 'batch-action-dropdown' }
    = t('.title')
    %span.caret
  %ul.dropdown-menu{"aria-labelledby" => 'batch-action-dropdown' }
    - options[:actions].each do |action, target|
      %li
        %a{ href: target, class: 'batch-action-form-submit-link' }= t(".#{action}")

:javascript
  $(document).ready(function() {
    $('.batch-action-checkbox').click(function() {
      var check_count = $('.batch-action-checkbox:checked').size();
      if( check_count > 0 ) {
        $("#batch-action-dropdown").show();
      } else {
        $("#batch-action-dropdown").hide();
      }
    });

    $('#batch-action-form').submit(function() {
      $('#batch-action-form input:checked').remove();
      var selected_items = $('.batch-action-checkbox:checked').clone();
      selected_items.css('display', 'none');
      $('#batch-action-form').append(selected_items);
      return true;
    });

    $('.batch-action-form-submit-link').click(function(e) {
        e.preventDefault();
        var target = $(this).attr('href');
        $("#batch-action-form").attr("action", target);
        $('#batch-action-form').submit();
    });
  });

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rails-add_ons-3.0.0.pre1 app/views/component/table/header_cells/_batch_actions.haml
rao-component-0.0.10.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.9.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.8.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.7.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.6.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.5.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.4.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.3.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.2.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml