mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
Merge pull request #55273 from nextcloud/refactor/a11y-util
refactor(core): use a11y activation util from `@nextcloud/vue`
This commit is contained in:
commit
c56343bdab
5 changed files with 7 additions and 29 deletions
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return whether the DOM event is an accessible mouse or keyboard element activation
|
||||
*
|
||||
* @param {Event} event DOM event
|
||||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
export const isA11yActivation = (event) => {
|
||||
if (event.type === 'click') {
|
||||
return true
|
||||
}
|
||||
if (event.type === 'keydown' && event.key === 'Enter') {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
5
core/src/jquery/contactsmenu.js
vendored
5
core/src/jquery/contactsmenu.js
vendored
|
|
@ -3,10 +3,9 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import $ from 'jquery'
|
||||
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import { isA11yActivation } from '../Util/a11y.js'
|
||||
import { isA11yActivation } from '@nextcloud/vue/functions/a11y'
|
||||
import $ from 'jquery'
|
||||
|
||||
const LIST = ''
|
||||
+ '<div class="menu popovermenu menu-left hidden contactsmenu-popover">'
|
||||
|
|
|
|||
4
core/src/jquery/ocdialog.js
vendored
4
core/src/jquery/ocdialog.js
vendored
|
|
@ -3,9 +3,9 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import $ from 'jquery'
|
||||
import { isA11yActivation } from '@nextcloud/vue/functions/a11y'
|
||||
import { createFocusTrap } from 'focus-trap'
|
||||
import { isA11yActivation } from '../Util/a11y.js'
|
||||
import $ from 'jquery'
|
||||
|
||||
$.widget('oc.ocdialog', {
|
||||
options: {
|
||||
|
|
|
|||
4
dist/core-main.js
vendored
4
dist/core-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-main.js.map
vendored
2
dist/core-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue