Replace fomantic popup module with tippy.js (#20428)

- replace fomantic popup module with tippy.js
- fix chaining and add comment
- add 100ms delay to tooltips
- stopwatch improvments, raise default maxWidth
- update web_src/js/features/common-global.js
- use type=submit instead of js
This commit is contained in:
silverwind 2022-08-09 14:37:34 +02:00 committed by GitHub
parent 36f9ee5813
commit 1b2cd4c4e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 199 additions and 2129 deletions

View file

@ -1,4 +1,5 @@
import $ from 'jquery';
import {createTippy} from '../modules/tippy.js';
const {csrfToken} = window.config;
@ -58,12 +59,12 @@ export function initRepoCommitLastCommitLoader() {
export function initCommitStatuses() {
$('.commit-statuses-trigger').each(function () {
const positionRight = $('.repository.file.list').length > 0 || $('.repository.diff').length > 0;
const popupPosition = positionRight ? 'right center' : 'left center';
$(this)
.popup({
on: 'click',
lastResort: popupPosition, // prevent error message "Popup does not fit within the boundaries of the viewport"
position: popupPosition,
});
createTippy(this, {
trigger: 'click',
content: this.nextSibling,
placement: positionRight ? 'right' : 'left',
interactive: true,
});
});
}