mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
961 B
28 lines
961 B
5 months ago
|
import {createTippy} from '../modules/tippy.ts';
|
||
|
import {toggleElem} from '../utils/dom.ts';
|
||
3 years ago
|
|
||
3 years ago
|
export function initRepoEllipsisButton() {
|
||
9 months ago
|
for (const button of document.querySelectorAll('.js-toggle-commit-body')) {
|
||
|
button.addEventListener('click', function (e) {
|
||
|
e.preventDefault();
|
||
|
const expanded = this.getAttribute('aria-expanded') === 'true';
|
||
|
toggleElem(this.parentElement.querySelector('.commit-body'));
|
||
|
this.setAttribute('aria-expanded', String(!expanded));
|
||
|
});
|
||
|
}
|
||
3 years ago
|
}
|
||
3 years ago
|
|
||
3 years ago
|
export function initCommitStatuses() {
|
||
9 months ago
|
for (const element of document.querySelectorAll('[data-tippy="commit-statuses"]')) {
|
||
|
const top = document.querySelector('.repository.file.list') || document.querySelector('.repository.diff');
|
||
2 years ago
|
|
||
9 months ago
|
createTippy(element, {
|
||
|
content: element.nextElementSibling,
|
||
2 years ago
|
placement: top ? 'top-start' : 'bottom-start',
|
||
2 years ago
|
interactive: true,
|
||
1 year ago
|
role: 'dialog',
|
||
1 year ago
|
theme: 'box-with-header',
|
||
2 years ago
|
});
|
||
9 months ago
|
}
|
||
3 years ago
|
}
|