Skip to content

Instantly share code, notes, and snippets.

@barakargaman
Last active December 30, 2015 15:19
Show Gist options
  • Select an option

  • Save barakargaman/7847640 to your computer and use it in GitHub Desktop.

Select an option

Save barakargaman/7847640 to your computer and use it in GitHub Desktop.

Revisions

  1. @barakarg barakarg revised this gist Dec 7, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@ var modes = ['free_submission_free_day',
    'paid_submission_bargain_day'
    ];
    $('input[type="checkbox"]').on('change', function() {
    var modes_code = _.map(modes, function(i){ ($('.'+i).val()) ? '1' : '.' };
    var rex = new RegExp(inputs_code, 'i');
    var modes_code = _.map(modes, function(i){ ($('.'+i).val()) ? '1' : '.' }).join();
    var rex = new RegExp(modes_code, 'i');
    $('.searchable tr').hide();
    $('.searchable tr').filter(function() {
    return rex.test($(this).data('modes_code'));
  2. @barakarg barakarg created this gist Dec 7, 2013.
    14 changes: 14 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    var modes = ['free_submission_free_day',
    'paid_submission_free_day',
    'free_submission_bargain_day',
    'paid_submission_bargain_day'
    ];
    $('input[type="checkbox"]').on('change', function() {
    var modes_code = _.map(modes, function(i){ ($('.'+i).val()) ? '1' : '.' };
    var rex = new RegExp(inputs_code, 'i');
    $('.searchable tr').hide();
    $('.searchable tr').filter(function() {
    return rex.test($(this).data('modes_code'));
    }).show();
    });
    });