Sha256: 9cb5f32a9e561283337b199da06a55139424e7b86f05f77dde27f86700cc1099

Contents?: true

Size: 1.44 KB

Versions: 33

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').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

33 entries across 33 versions & 1 rubygems

Version Path
rao-component-0.0.43.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.42.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.41.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.40.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.39.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.38.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.37.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.36.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.35.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.34.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.33.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.32.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.31.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.30.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.29.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.28.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.27.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.26.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.25.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml
rao-component-0.0.24.pre app/views/rao/component/table/header_cells/_batch_actions.html.haml