1
0
Fork 0
forked from forgejo/forgejo

Improve ellipsis buttons (#17773)

* Improve ellipsis buttons

- Remove icon font usage
- Add aria-expanded attribute

* rename function to match

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
silverwind 2021-11-23 03:44:38 +01:00 committed by GitHub
parent e595986458
commit 9450410ff7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 7 deletions

View file

@ -1,9 +1,11 @@
const {csrfToken} = window.config;
export function initRepoCommitButton() {
$('.commit-button').on('click', function (e) {
export function initRepoEllipsisButton() {
$('.ellipsis-button').on('click', function (e) {
e.preventDefault();
const expanded = $(this).attr('aria-expanded') === 'true';
$(this).parent().find('.commit-body').toggle();
$(this).attr('aria-expanded', String(!expanded));
});
}