Sha256: a62c507a68ce464ec403baff32991f422fcb5628e26ca7518980be1d8b579639

Contents?: true

Size: 1.03 KB

Versions: 19

Compression:

Stored size: 1.03 KB

Contents

$(function() {
  $('#filter').on('keyup', function() {
    $input = $(this);

    if ($input.val() === '') {
      $('div.experiment').show();
      return false;
    }

    $('div.experiment').hide();
    selector = 'div.experiment[data-name*="' + $input.val() + '"]';
    $(selector).show();
  });

  $('#clear-filter').on('click', function() {
    $('#filter').val('');
    $('div.experiment').show();
    $('#toggle-active').val('Hide active');
    $('#toggle-completed').val('Hide completed');
  });

  $('#toggle-active').on('click', function() {
    $button = $(this);
    if ($button.val() === 'Hide active') {
      $button.val('Show active');
    } else {
      $button.val('Hide active');
    }

    $('div.experiment[data-complete="false"]').toggle();
  });

  $('#toggle-completed').on('click', function() {
    $button = $(this);
    if ($button.val() === 'Hide completed') {
      $button.val('Show completed');
    } else {
      $button.val('Hide completed');
    }

    $('div.experiment[data-complete="true"]').toggle();
  });
});

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
split-4.0.4 lib/split/dashboard/public/dashboard-filtering.js
split-4.0.3 lib/split/dashboard/public/dashboard-filtering.js
split-4.0.2 lib/split/dashboard/public/dashboard-filtering.js
split-4.0.1 lib/split/dashboard/public/dashboard-filtering.js
split-4.0.0.pre2 lib/split/dashboard/public/dashboard-filtering.js
split-4.0.0.pre lib/split/dashboard/public/dashboard-filtering.js
ab-split-1.0.2 lib/split/dashboard/public/dashboard-filtering.js
ab-split-1.0.1 lib/split/dashboard/public/dashboard-filtering.js
ab-split-1.0.0 lib/split/dashboard/public/dashboard-filtering.js
split-3.4.1 lib/split/dashboard/public/dashboard-filtering.js
split-3.4.0 lib/split/dashboard/public/dashboard-filtering.js
split-3.3.2 lib/split/dashboard/public/dashboard-filtering.js
split-3.3.1 lib/split/dashboard/public/dashboard-filtering.js
split-3.3.0 lib/split/dashboard/public/dashboard-filtering.js
split-3.2.0 lib/split/dashboard/public/dashboard-filtering.js
split-3.1.1 lib/split/dashboard/public/dashboard-filtering.js
split-3.1.0 lib/split/dashboard/public/dashboard-filtering.js
split-3.0.0 lib/split/dashboard/public/dashboard-filtering.js
split-2.2.0 lib/split/dashboard/public/dashboard-filtering.js