Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawer toggle a11y rebase #1032

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0744e83
Refactor element drawers.
kimisgold Oct 17, 2022
c8b54d7
Update navigation settings with new drawer markup.
kimisgold Oct 24, 2022
429ce51
Refactor drawer button action js.
kimisgold Oct 26, 2022
e6d1ccc
Hide navigation checkboxes in deleted state.
kimisgold Oct 27, 2022
7aaec4d
Fix navigation deletion.
kimisgold Oct 27, 2022
ae0db0a
Hide sortable item icons from screen readers.
kimisgold Oct 27, 2022
5a2dcc4
Have add new files pane open by default.
kimisgold Oct 27, 2022
5122198
Fix item type element deletion functionality.
kimisgold Nov 1, 2022
521fb93
Expose move icon tooltip to screen readers.
kimisgold Nov 1, 2022
e197676
Fix navigation link aria label counts.
kimisgold Nov 1, 2022
4638e80
Show sortable icon, open drawer when adding link.
kimisgold Nov 1, 2022
0e345cb
Support template mode in navigation link partial.
kimisgold Nov 2, 2022
6092efe
Add drawerList parameter to manageDrawers.
kimisgold Nov 2, 2022
043120c
Hide navigation link template.
kimisgold Nov 2, 2022
2c3c1b3
Improve add navigation link panel aria labeling.
kimisgold Nov 2, 2022
39a307e
Remove manageDrawers call from navigation.js.
kimisgold Nov 2, 2022
397a7e7
Target link status checkbox with '.link-status'.
kimisgold Nov 2, 2022
387b033
Use template approach to inserting new links.
kimisgold Nov 2, 2022
1c09927
Remove anchor specific js.
kimisgold Nov 2, 2022
a4f8082
Add proper role to add new element button.
kimisgold Nov 2, 2022
0a0951e
Use delete toggle pattern with new elements.
kimisgold Nov 2, 2022
c72d4bb
Keep new element names visible in delete state.
kimisgold Nov 2, 2022
812a282
Connect new item type element aria labels.
kimisgold Nov 3, 2022
c38499b
Add sr success message for newly added elements.
kimisgold Nov 3, 2022
d2b7313
Add item type list argument to manageDrawers.
kimisgold Nov 3, 2022
139e274
Do not add manageDrawers as a ready callback.
kimisgold Nov 3, 2022
40f47cb
Make move icon labels more descriptive.
kimisgold Jan 11, 2023
24ad541
Provide admin bar an aria label.
kimisgold May 16, 2024
e317977
Handle next button focus when toggling drawer's deletion state.
kimisgold Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions admin/themes/default/appearance/edit-navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ class="<?php echo $this->form->getAttrib('class') ?>" >
. 'in the main navigation. Click and drag the links into the preferred '
. 'display order.'); ?></p>
<?php echo $this->form->displayNavigationLinks(); ?>
<?php echo $this->partial('settings/edit-navigation-link.php', array('template' => true)); ?>
<?php echo $this->form->getElement(Omeka_Form_Navigation::HIDDEN_ELEMENT_ID); ?>
<div class="add-new"><?php echo __('Add a Link to the Navigation'); ?></div>
<div class="drawer-contents">
<label for="new_nav_link_label"><?php echo __('Label'); ?></label>
<input type="text" id="new_nav_link_label" name="new_nav_link_label" />
<label for="new_nav_link_uri"><?php echo __('URL'); ?></label>
<input type="text" id="new_nav_link_uri" name="new_nav_link_uri" />
<a href="" id="new_nav_link_button_link" class="blue button"><?php echo __('Add Link'); ?></a>
<div class="add-new" id="add-new-heading"><?php echo __('Add a Link to the Navigation'); ?></div>
<div id="add-new-options" class="drawer-contents opened">
<div id="new-link-success" class="sr-only flash" style="display: none" aria-live="polite"><?php echo __('New Link Added. Total links: '); ?><span class="link-count"></span></div>
<label id="new_nav_link_label_label"><?php echo __('Label'); ?></label>
<input type="text" id="new_nav_link_label" aria-labelledby="add-new-heading new_nav_link_label_label" name="new_nav_link_label" />
<div class="flash alert" style="display: none;" id="label-required" aria-live="polite"><?php echo __('required field'); ?> <span class="sr-only"><?php echo __('Label'); ?></span></div>
<label id="new_nav_link_uri_label"><?php echo __('URL'); ?></label>
<input type="text" id="new_nav_link_uri" name="new_nav_link_uri" aria-labelledby="add-new-heading new_nav_link_uri_label" />
<div class="flash alert" style="display: none;" id="uri-required" aria-live="polite"><?php echo __('required field'); ?> <span class="sr-only"><?php echo __('URI'); ?></span></div>
<button type="button" id="new_nav_link_button_link" class="blue button"><?php echo __('Add Link'); ?></button>
</div>
<?php fire_plugin_hook('admin_appearance_navigation_form', array('form' => $form, 'view' => $this)); ?>
</section>
Expand All @@ -47,5 +51,6 @@ class="<?php echo $this->form->getAttrib('class') ?>" >
Omeka.addReadyCallback(Omeka.Navigation.addNewNavLinkForm);
Omeka.addReadyCallback(Omeka.Navigation.updateForNewLinks);
Omeka.addReadyCallback(Omeka.Navigation.setUpFormSubmission);
Omeka.manageDrawers('#navigation_main_list', '.main_link');
</script>
<?php echo foot(); ?>
108 changes: 61 additions & 47 deletions admin/themes/default/css/sass/components/_draggables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
.sortable-item {
cursor: move;

&:before {
.move.icon:before {
display: inline-block;
font-family: "Font Awesome 5 Free";
font-weight: 900;
Expand All @@ -28,27 +28,8 @@
content: "\f0b2";
opacity: 0.5;
position: relative;

#exhibit-page-form & {
top: 0px;
position: relative;
float: left;
}
}

> a {
max-width: 350px;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.5;
vertical-align: top;

@include screen-xs {
max-width: 180px;
}
}
}

li {
Expand All @@ -63,11 +44,11 @@
background: $lightgray;
box-shadow: 0 0 $spacing-s rgba(0,0,0,0.1);
border: 1px solid $darkgrayborder;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
padding: 15px;
margin: 0;
display: flex;
align-items: center;

input {
margin: 0;
Expand All @@ -76,8 +57,11 @@

.action-links {
display: inline-block;
float: right;
}

.action-links li {
margin-bottom: 0;
}
}

.ui-sortable-highlight:empty {
Expand All @@ -93,15 +77,37 @@
border-radius: 2px;
}

.drawer-toggle,
.delete-element,
.undo-delete {
float: right;
height: $spacing-l;
width: $spacing-l;
cursor: pointer;
text-indent: -9999px;
.drawer-name {
margin-right: auto !important;
}

.drawer > button {
max-width: 350px;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.5;
vertical-align: top;
background-color: transparent;
padding: 0;
border: 0;
margin-bottom: 0;
color: #4C3939;

@include screen-xs {
max-width: 180px;
}
}

.drawer.deleted .delete-drawer,
.drawer.deleted .drawer-toggle,
.drawer .undo-delete {
display: none;
}

.drawer.deleted .undo-delete {
display: inline-block;
}

.deleted.sortable-item,
Expand All @@ -117,54 +123,62 @@
* {
color: #fff;
}

input.drawer-name,
select.drawer-name {
color: $black;
}
}

.deleted.drawer input.link-status {
display: none;
}

.deleted a:link,
.deleted a:visited {
color: #fff;
text-shadow: -1px -1px 1px rgba(0,0,0,.5);
}
.deleted .drawer { color: #fff; }

.drawer-contents { display: none; }

.drawer-contents.opened:not(.deleted) { display: block; }

.drawer-toggle:after,
.delete-element:after,
.undo-delete:after {
.drawer-toggle .icon:after,
.delete-drawer .icon:after,
.undo-delete .icon:after {
display: inline-block;
font-family: "Font Awesome 5 Free";
font-weight: 900;
font-size: 16px;
height: $spacing-l;
width: $spacing-l;
text-indent: 0;
float: left;
text-align: center;
}
.drawer-toggle:after { content: "\f0da"; }
.drawer-toggle .icon:after { content: "\f0da"; }

.delete-element:link, .delete-element:active,
.delete-element:hover, .delete-element:visited,
.delete-drawer:link, .delete-drawer:active,
.delete-drawer:hover, .delete-drawer:visited,
.undo-delete:link, .undo-delete:active,
.undo-delete:hover, .undo-delete:visited {
color: #4C3939;
}

.drawer-toggle.opened:after {
.drawer.opened .drawer-toggle .icon:after {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}

.delete-element { display: inline-block; }
.delete-element:after { content: "\f00d"; }

.drawer > a.undo-delete,
.ui-sortable .sortable-item > a.undo-delete { display: none; }
.delete-drawer { display: inline-block; }
.delete-drawer .icon:after { content: "\f00d"; }

.undo-delete:after {
.undo-delete .icon:after {
content: "\f0e2";
font-size: 12px;
line-height: 2em;
line-height: 1;
color: #fff;
}

Expand Down
11 changes: 2 additions & 9 deletions admin/themes/default/css/sass/pages/_items.scss
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
min-width: 150px;
}

.delete-element {
.delete-drawer {
clear: both;
display: block;
}
Expand All @@ -500,11 +500,4 @@
border-top: 1px solid #ccc;
margin-top: 10px;
padding: 9px 0 10px;
}

/* Edit Item Type Metadata
================================================== */

.item-type-metadata .drawer-toggle { display: none; }

.item-type-metadata .sortable-item { cursor: default; }
}
4 changes: 4 additions & 0 deletions admin/themes/default/css/sass/pages/_settings.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#fieldset-site_settings legend {
@extend .sr-only;
}

#navigation_form .template {
display: none;
}
Loading