Proof of concept idea for the "filter category" idea

http://board.s9y.org/viewtopic.php?f=11&t=19862
This commit is contained in:
Garvin Hicking 2014-04-24 15:21:25 +02:00
parent f704df9365
commit 063b753892
2 changed files with 22 additions and 0 deletions

View File

@ -107,6 +107,12 @@
<div id="edit_entry_category" class="clearfix mfp-hide">
<fieldset>
<span class="wrap_legend"><legend>{$CONST.CATEGORY}</legend></span>
<div class="category_filter">
<label for="categoryfilter">{$CONST.FILTERS}</label>
<input type="text" id="categoryfilter">
</div>
{foreach from=$entry_vars.category_options item="entry_cat"}
<div class="form_check">
{$entry_cat.depth_pad}

View File

@ -983,6 +983,22 @@ $(function() {
}
{/if}
$('#categoryfilter').keyup(function() {
var current_categoryfilter = $(this).val().toLowerCase();
if (current_categoryfilter == '') {
$('#edit_entry_category .form_check').toggle(true);
} else {
$('#edit_entry_category .form_check').each(function() {
if ($(this).find('label').html().toLowerCase().indexOf(current_categoryfilter) > -1) {
$(this).toggle(true);
} else {
$(this).toggle(false);
}
});
}
});
// Advanced options
if($('#advanced_options').length > 0) {
$('#toggle_advanced').click(function() {