Skip to content

Commit

Permalink
Add label and switch ocdialog close button to button element
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Mar 3, 2023
1 parent c5da4b8 commit e91ec29
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions core/src/jquery/css/jquery.ocdialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@

.oc-dialog-close {
position: absolute;
top: 0;
right: 0;
width: 44px !important;
height: 44px !important;
top: 4px;
right: 4px;
padding: 25px;
background: var(--icon-close-dark) no-repeat center;
opacity: .5;
Expand Down
3 changes: 2 additions & 1 deletion core/src/jquery/ocdialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ $.widget('oc.ocdialog', {
break
case 'closeButton':
if (value) {
const $closeButton = $('<a class="oc-dialog-close" tabindex="0"></a>')
const $closeButton = $('<button class="oc-dialog-close"></button>')
$closeButton.attr('aria-label', t('core', 'Close "{dialogTitle}" dialog', { dialogTitle: this.$title || this.options.title }))
this.$dialog.prepend($closeButton)
$closeButton.on('click keydown', function(event) {
if (isA11yActivation(event)) {
Expand Down
4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.

0 comments on commit e91ec29

Please sign in to comment.