Add reset button for category filter; add some styling.
References #123
This commit is contained in:
@ -108,9 +108,10 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<span class="wrap_legend"><legend>{$CONST.CATEGORY}</legend></span>
|
<span class="wrap_legend"><legend>{$CONST.CATEGORY}</legend></span>
|
||||||
|
|
||||||
<div class="category_filter">
|
<div id="category_filter" class="form_field">
|
||||||
<label for="categoryfilter">{$CONST.FILTERS}</label>
|
<label for="categoryfilter" class="visuallyhidden">{$CONST.FILTERS}</label>
|
||||||
<input type="text" id="categoryfilter">
|
<input id="categoryfilter" type="text" placeholder="{$CONST.FILTERS}: {$CONST.CATEGORIES}">
|
||||||
|
<button id="reset_categoryfilter" class="icon_link" type="button" title="Reset filters"><span class="icon-cancel"></span><span class="visuallyhidden">Reset filters</span></button> {* i18n *}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{foreach from=$entry_vars.category_options item="entry_cat"}
|
{foreach from=$entry_vars.category_options item="entry_cat"}
|
||||||
|
@ -983,6 +983,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
// Category filter
|
||||||
$('#categoryfilter').keyup(function() {
|
$('#categoryfilter').keyup(function() {
|
||||||
var current_categoryfilter = $(this).val().toLowerCase();
|
var current_categoryfilter = $(this).val().toLowerCase();
|
||||||
|
|
||||||
@ -990,15 +991,21 @@ $(function() {
|
|||||||
$('#edit_entry_category .form_check').toggle(true);
|
$('#edit_entry_category .form_check').toggle(true);
|
||||||
} else {
|
} else {
|
||||||
$('#edit_entry_category .form_check').each(function() {
|
$('#edit_entry_category .form_check').each(function() {
|
||||||
if ($(this).find('label').html().toLowerCase().indexOf(current_categoryfilter) > -1) {
|
var $el = $(this);
|
||||||
$(this).toggle(true);
|
if ($el.find('label').html().toLowerCase().indexOf(current_categoryfilter) > -1) {
|
||||||
|
$el.toggle(true);
|
||||||
} else {
|
} else {
|
||||||
$(this).toggle(false);
|
$el.toggle(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Reset button for category filter
|
||||||
|
$('#reset_categoryfilter').click(function() {
|
||||||
|
$('#categoryfilter').val("").keyup();
|
||||||
|
});
|
||||||
|
|
||||||
// Advanced options
|
// Advanced options
|
||||||
if($('#advanced_options').length > 0) {
|
if($('#advanced_options').length > 0) {
|
||||||
$('#toggle_advanced').click(function() {
|
$('#toggle_advanced').click(function() {
|
||||||
|
@ -1259,6 +1259,10 @@ summary {
|
|||||||
padding: .4em 0;
|
padding: .4em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#categoryfilter {
|
||||||
|
min-width: 20em;
|
||||||
|
}
|
||||||
|
|
||||||
.user_level {
|
.user_level {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@ -2146,6 +2150,7 @@ label .perm_name,
|
|||||||
.no-js .comment_summary,
|
.no-js .comment_summary,
|
||||||
.no-js .show_config_option .icon-right-dir,
|
.no-js .show_config_option .icon-right-dir,
|
||||||
.no-js #keyword_list,
|
.no-js #keyword_list,
|
||||||
|
.no-js #category_filter,
|
||||||
.js .additional_info,
|
.js .additional_info,
|
||||||
.js .installer .icon-info-circled,
|
.js .installer .icon-info-circled,
|
||||||
.hidden,
|
.hidden,
|
||||||
|
Reference in New Issue
Block a user