1
0
Fork 0
forked from forgejo/forgejo

Remove customized (unmaintained) dropdown, improve aria a11y for dropdown (#19861)

* Remove customized (unmaintained) dropdown, improve aria a11y for dropdown

* fix repo permission

* use action instead of onChange

* re-order the CSS selector

* fix dropdown behavior for repo permissions, make elements inside menu item non-focusable

* use menu/menuitem instead of combobox/option. use tooltip(data-content) for aria-label, prevent from repeated attaching

* click menu item when pressing Enter

* code format

* fix repo permission

* repo setting: prevent from misleading users when error occurs

* fine tune the repo collaboration access mode dropdown (in case the access mode is undefined in the template)

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
wxiaoguang 2022-06-04 05:38:26 +08:00 committed by GitHub
parent 1d04e8641d
commit 694441fec5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 195 additions and 4459 deletions

View file

@ -4,6 +4,7 @@ import {mqBinarySearch} from '../utils.js';
import createDropzone from './dropzone.js';
import {initCompColorPicker} from './comp/ColorPicker.js';
import {showGlobalErrorMessage} from '../bootstrap.js';
import {attachDropdownAria} from './aria.js';
const {appUrl, csrfToken} = window.config;
@ -97,24 +98,27 @@ export function initGlobalCommon() {
}
// Semantic UI modules.
$('.dropdown:not(.custom)').dropdown({
const $uiDropdowns = $('.ui.dropdown');
$uiDropdowns.filter(':not(.custom)').dropdown({
fullTextSearch: 'exact'
});
$('.jump.dropdown').dropdown({
$uiDropdowns.filter('.jump').dropdown({
action: 'hide',
onShow() {
$('.tooltip').popup('hide');
},
fullTextSearch: 'exact'
});
$('.slide.up.dropdown').dropdown({
$uiDropdowns.filter('.slide.up').dropdown({
transition: 'slide up',
fullTextSearch: 'exact'
});
$('.upward.dropdown').dropdown({
$uiDropdowns.filter('.upward').dropdown({
direction: 'upward',
fullTextSearch: 'exact'
});
attachDropdownAria($uiDropdowns);
$('.ui.checkbox').checkbox();
// init popups