diff --git a/themes/finc/js/advanced_search.js b/themes/finc/js/advanced_search.js index 5dad9556167bd8b8b43e983a3b53e7b2f05d26a9..dde587e5f5a727b796cbeae9590cec96e99720f0 100644 --- a/themes/finc/js/advanced_search.js +++ b/themes/finc/js/advanced_search.js @@ -10,10 +10,13 @@ function addSearch(group, _fieldValues) { var $newSearch = $($('#new_search_template').html()); $newSearch.attr('id', 'search' + inputID); + $newSearch.find('fieldset legend').text($newSearch.find('fieldset legend').text().replace('1', (groupLength[group] + 1))); $newSearch.find('input.form-control') .attr('id', 'search_lookfor' + inputID) .attr('name', 'lookfor' + group + '[]') .val(''); + $newSearch.find('.adv-input label').attr('for', 'search_lookfor' + inputID); + $newSearch.find('.adv-select label').attr('for', 'search_type' + inputID); $newSearch.find('select.adv-term-type option:first-child').attr('selected', 1); $newSearch.find('select.adv-term-type') .attr('id', 'search_type' + inputID) @@ -44,7 +47,6 @@ function addSearch(group, _fieldValues) { .attr('name', 'op' + group + '[]') .removeClass('hidden'); $newSearch.find('.first-op').remove(); - $newSearch.find('label').remove(); // Show x if we have more than one search inputs $('#group' + group + ' .adv-term-remove').removeClass('hidden'); } @@ -67,7 +69,12 @@ function deleteSearch(group, sindex) { } if (groupLength[group] > 1) { groupLength[group]--; - $('#search' + group + '_' + groupLength[group]).remove(); + var toRemove = $('#search' + group + '_' + groupLength[group]); + var parent = toRemove.parent(); + toRemove.remove(); + if(parent.length) { + parent.find('.adv-search input.form-control').focus(); + } if (groupLength[group] === 1) { $('#group' + group + ' .adv-term-remove').addClass('hidden'); // Hide x } @@ -84,6 +91,7 @@ function addGroup(_firstTerm, _firstField, _join) { $newGroup.find('.adv-group-label') // update label .attr('for', 'search_lookfor' + nextGroup + '_0'); $newGroup.attr('id', 'group' + nextGroup); + $newGroup.attr('aria-label', $newGroup.attr('aria-label').replace('0', nextGroup + 1)); $newGroup.find('.search_place_holder') .attr('id', 'group' + nextGroup + 'Holder') .removeClass('hidden'); diff --git a/themes/finc/templates/search/advanced/limit.phtml b/themes/finc/templates/search/advanced/limit.phtml index 3a48c286d3ff45643374b11c44fe93e25d0941f7..1143d26934ef25977b5349a1ea7bda7ea273530d 100644 --- a/themes/finc/templates/search/advanced/limit.phtml +++ b/themes/finc/templates/search/advanced/limit.phtml @@ -10,12 +10,12 @@ <?php if (count($limitList) > 1): ?> <fieldset class="limits"> <legend><?=$this->transEsc('Results per page')?></legend> + <label for="limit"><?=$this->transEsc('Limit To')?></label> <select id="limit" name="limit" class="form-control"> <?php foreach ($limitList as $limitVal): ?> <option value="<?=$this->escapeHtmlAttr($limitVal)?>" <?=($limitVal == $defaultLimit) ? 'selected="selected"' : ''?>><?=$this->escapeHtml($limitVal)?></option> <?php endforeach; ?> </select> - <label for="limit"><?=$this->transEsc('Limit To')?></label> </fieldset> <?php endif; ?> <!-- finc: search - advanced - limit - END --> \ No newline at end of file