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