Sha256: f898dbb66cc0b89e76a7826ec1a352f359c3c2bac7dfa50d06dbf1237352b1f9

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 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

11 entries across 11 versions & 1 rubygems

Version Path
split-2.1.0 lib/split/dashboard/public/dashboard-filtering.js
split-2.0.0 lib/split/dashboard/public/dashboard-filtering.js
split-1.7.0 lib/split/dashboard/public/dashboard-filtering.js
split-1.6.0 lib/split/dashboard/public/dashboard-filtering.js
split-1.5.0 lib/split/dashboard/public/dashboard-filtering.js
split-1.4.5 lib/split/dashboard/public/dashboard-filtering.js
split-1.4.4 lib/split/dashboard/public/dashboard-filtering.js
split-1.4.3 lib/split/dashboard/public/dashboard-filtering.js
split-1.4.2 lib/split/dashboard/public/dashboard-filtering.js
split-1.4.1 lib/split/dashboard/public/dashboard-filtering.js
split-1.4.0 lib/split/dashboard/public/dashboard-filtering.js