Skip to content

Commit f4fb4e0

Browse files
committed
Make cover image and attachment modals consistent.
* Redo search toggle button to use aria-labels, split into two. * Remove css hiding filters or cover image.
1 parent 720769d commit f4fb4e0

4 files changed

Lines changed: 32 additions & 49 deletions

File tree

views/admin/css/exhibits.css

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -89,34 +89,10 @@
8989

9090
/* Item select */
9191

92-
.show-search-label,
93-
.hide-search-label {
94-
display: block;
95-
padding: 10px;
96-
}
97-
98-
.show-search-label:before,
99-
.hide-search-label:before {
100-
font-family: "Font Awesome 5 Free";
101-
font-weight: 900;
102-
}
103-
104-
.show-search-label:before {
105-
content: "\f002";
106-
}
107-
108-
.hide-search-label:before {
109-
content: "\f30a";
110-
}
111-
11292
#item-select {
11393
padding: 0;
11494
}
11595

116-
#cover-image-panel #item-filters {
117-
display: none;
118-
}
119-
12096
#item-filters,
12197
#item-filters ul {
12298
display: inline-block;
@@ -247,27 +223,37 @@
247223
font-family: "Lato", sans-serif;
248224
}
249225

250-
#show-or-hide-search {
226+
.search-toggle {
251227
float: left;
252228
margin-bottom: 10px;
253-
padding: 0;
254-
}
255-
256-
#view-all-items {
229+
padding: 10px;
257230
display: none;
258-
padding: 3px 12px;
259231
}
260232

261-
#item-filters + #view-all-items {
233+
.search-toggle.active {
262234
display: inline-block;
263235
}
264236

265-
#show-or-hide-search.show-form .hide-search-label {
266-
display: none;
237+
.search-toggle:before {
238+
font-family: "Font Awesome 5 Free";
239+
font-weight: 900;
240+
}
241+
242+
.show-form:before {
243+
content: "\f002";
267244
}
268245

269-
#show-or-hide-search.hide-form .show-search-label {
246+
.hide-form:before {
247+
content: "\f30a";
248+
}
249+
250+
#view-all-items {
270251
display: none;
252+
padding: 3px 12px;
253+
}
254+
255+
#item-filters + #view-all-items {
256+
display: inline-block;
271257
}
272258

273259
#change-selected-item, #revert-selected-item {

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +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" id="show-or-hide-search" class="show-form blue">
121-
<span class="show-search-label"><?php echo __('Show Search Form'); ?></span>
122-
<span class="hide-search-label"><?php echo __('Hide Search Form'); ?></span>
123-
</button>
124-
<a href="<?php echo url('exhibit-builder/items/browse'); ?>" id="view-all-items" class="green button"><?php echo __('View All Items'); ?></a>
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>
125122
</div>
126123
<div id="page-search-form" class="container-twelve">
127124
<?php

views/admin/exhibits/page-form.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@
9494
</form>
9595
<div id="attachment-panel" title="<?php echo html_escape(__('Attach an Item')); ?>">
9696
<div id="item-form">
97-
<button type="button" id="revert-selected-item"><?php echo __('Revert to Selected Item'); ?></button>
98-
<button type="button" id="show-or-hide-search" class="show-form blue">
99-
<span class="show-search-label" title="<?php echo __('Show Search Form'); ?>"></span>
100-
<span class="hide-search-label" title="<?php echo __('Hide Search Form'); ?>"></span>
101-
</button>
97+
<div class="browse-controls">
98+
<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>
101+
</div>
102102
<div id="page-search-form" class="container-twelve">
103103
<?php
104104
$action = url(array('module' => 'exhibit-builder',

views/admin/javascripts/exhibits.js

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

2929
if (typeof show === 'undefined') {
3030
show = !searchForm.is(':visible');
3131
}
32+
3233
if (show) {
3334
searchForm.show();
34-
searchButton.addClass('hide-form').removeClass('show-form');
3535
} else {
3636
searchForm.hide();
37-
searchButton.addClass('show-form').removeClass('hide-form');
3837
}
38+
searchToggleButton.toggleClass('active');
3939
}
4040

4141
Omeka.ExhibitBuilder.loadItemOptionsForm = function(data, itemOptionsUrl, panel, options) {
@@ -227,7 +227,7 @@ Omeka.ExhibitBuilder = {};
227227
});
228228

229229
Omeka.ExhibitBuilder.setSearchVisibility(false);
230-
$('#show-or-hide-search').click(function (event) {
230+
$('.search-toggle').click(function (event) {
231231
event.preventDefault();
232232
Omeka.ExhibitBuilder.setSearchVisibility();
233233
});
@@ -547,7 +547,7 @@ Omeka.ExhibitBuilder = {};
547547
});
548548

549549
Omeka.ExhibitBuilder.setSearchVisibility(false);
550-
$('#show-or-hide-search').click(function (event) {
550+
$('.search-toggle').click(function (event) {
551551
event.preventDefault();
552552
Omeka.ExhibitBuilder.setSearchVisibility();
553553
});

0 commit comments

Comments
 (0)