Sha256: 2e7c3d3b1685919bde0a2a6c9b313b87da3cab50f4da698eb59ac1870b55de23

Contents?: true

Size: 1.47 KB

Versions: 9

Compression:

Stored size: 1.47 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-xs.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 btn btn-xs btn-link' }= t(".#{action}")

:javascript
  $(document).ready(function() {
    $('.batch-action-checkbox').click(function() {
      var check_count = $('.batch-action-checkbox:checked').length;
      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

9 entries across 9 versions & 1 rubygems

Version Path
rao-component-0.0.52.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.51.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.50.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.49.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.48.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.47.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.46.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.45.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.44.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml