Skip to content

Commit 9250587

Browse files
committed
Be more specific in handling active class on search toggle.
1 parent f4fb4e0 commit 9250587

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

views/admin/exhibits/exhibit-metadata-form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@
117117
<div id="item-form">
118118
<div class="browse-controls">
119119
<button type="button" id="revert-selected-item">Revert to Selected Item</button>
120-
<button type="button" class="search-toggle show-form blue" aria-label="<?php echo __('Show Search Form'); ?>" title="<?php echo __('Show Search Form'); ?>"></button>
121-
<button type="button" class="search-toggle hide-form blue active" aria-label="<?php echo __('Hide Search Form'); ?>" title="<?php echo __('Hide Search Form'); ?>"></button>
120+
<button type="button" class="search-toggle show-form blue active" aria-label="<?php echo __('Show Search Form'); ?>" title="<?php echo __('Show Search Form'); ?>"></button>
121+
<button type="button" class="search-toggle hide-form blue" aria-label="<?php echo __('Hide Search Form'); ?>" title="<?php echo __('Hide Search Form'); ?>"></button>
122122
</div>
123123
<div id="page-search-form" class="container-twelve">
124124
<?php

views/admin/exhibits/page-form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
<div id="item-form">
9797
<div class="browse-controls">
9898
<button type="button" id="revert-selected-item">Revert to Selected Item</button>
99-
<button type="button" class="search-toggle show-form blue" aria-label="<?php echo __('Show Search Form'); ?>" title="<?php echo __('Show Search Form'); ?>"></button>
100-
<button type="button" class="search-toggle hide-form blue active" aria-label="<?php echo __('Hide Search Form'); ?>" title="<?php echo __('Hide Search Form'); ?>"></button>
99+
<button type="button" class="search-toggle show-form blue active" aria-label="<?php echo __('Show Search Form'); ?>" title="<?php echo __('Show Search Form'); ?>"></button>
100+
<button type="button" class="search-toggle hide-form blue" aria-label="<?php echo __('Hide Search Form'); ?>" title="<?php echo __('Hide Search Form'); ?>"></button>
101101
</div>
102102
<div id="page-search-form" class="container-twelve">
103103
<?php

views/admin/javascripts/exhibits.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,20 @@ Omeka.ExhibitBuilder = {};
2424
}
2525
Omeka.ExhibitBuilder.setSearchVisibility = function(show) {
2626
var searchForm = $('#page-search-form');
27-
var searchToggleButton = $('.search-toggle');
2827

2928
if (typeof show === 'undefined') {
3029
show = !searchForm.is(':visible');
3130
}
3231

32+
$('.search-toggle.active').removeClass('active');
33+
3334
if (show) {
3435
searchForm.show();
36+
$('.hide-form').addClass('active');
3537
} else {
3638
searchForm.hide();
39+
$('.show-form').addClass('active');
3740
}
38-
searchToggleButton.toggleClass('active');
3941
}
4042

4143
Omeka.ExhibitBuilder.loadItemOptionsForm = function(data, itemOptionsUrl, panel, options) {

0 commit comments

Comments
 (0)