Skip to content

Commit

Permalink
Issue #19: Follow up to ensure jQuery still works.
Browse files Browse the repository at this point in the history
Fixes #19.
  • Loading branch information
laryn authored May 29, 2024
1 parent 73f8aab commit a51054e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 5 additions & 9 deletions better_exposed_filters.theme.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
* Themes a select element as checkboxes enclosed in a collapsible fieldset.
*
* @param array $vars
* An array of arrays, the 'element' item holds the properties of the element
* An array of arrays, the 'element' item holds the properties of the element.
*
* @return string
* HTML representing the form element.
*/
function theme_select_as_checkboxes_fieldset($vars) {
// Merge incoming element with some default values. Prevents a lot of this.
// $foo = isset($bar) ? $bar : $bar_default;
// $foo = isset($bar) ? $bar : $bar_default;.
$element = array_merge(
array(
'#bef_title' => '',
Expand Down Expand Up @@ -226,7 +226,7 @@ function theme_select_as_hidden($vars) {
*/
function theme_select_as_radios_fieldset($vars) {
// Merge incoming element with some default values. Prevents a lot of this.
// $foo = isset($bar) ? $bar : $bar_default;
// $foo = isset($bar) ? $bar : $bar_default;.
$element = array_merge(
array(
'#bef_title' => '',
Expand Down Expand Up @@ -463,6 +463,7 @@ function theme_select_as_tree($vars) {
* HTML representing the form element.
*/
function theme_select_as_links($vars) {
// @todo: Clean up this entire function to better use render arrays.
$element = $vars['element'];

$output = '';
Expand Down Expand Up @@ -599,11 +600,6 @@ function theme_select_as_links($vars) {
'form-item',
),
),
'wrapper_attributes' => array(
'class' => array(
'bef-select-as-links',
),
),
));

$list_wrapper = array(
Expand All @@ -627,7 +623,7 @@ function theme_select_as_links($vars) {
}
}

return $output;
return '<div class="bef-select-as-links">' . $output . '</div>';
}

/**
Expand Down
6 changes: 4 additions & 2 deletions js/better_exposed_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,10 @@
$wrapper.parents('form').find('.views-submit-button *[type=submit]').trigger('click');
});

// Announce the current filter to screen readers.
Backdrop.announce(Backdrop.t('The page has been filtered to show !linktext content.', { '!linktext': $active_text }));
if (typeof $active_text != 'undefined') {
// Announce the current filter to screen readers.
Backdrop.announce(Backdrop.t('The page has been filtered to show !linktext content.', { '!linktext': $active_text }));
}
});
}
};
Expand Down

0 comments on commit a51054e

Please sign in to comment.