forked from forgejo/forgejo
Improve PR Review Box UI (#22986)
This PR follows: * #22950 ### Before The Review Box has many problems: * It doesn't work for small screens. * It has an anonying animation which makes the UI laggy. * It uses "custom dropdown menu" which is very difficult to fine tune. * `$().toggle('visible')` is not a correct call * jQuery just accepts any invalid `duration` argument: `$().toggle('anyting')` * The button is not a button. <details>  </details> ### After These problems are fixed, and eliminate many `!important` games. <details>    </details> And most dropdown icons still looks good: <details>   </details> Co-authored-by: delvh <leon@kske.dev>
This commit is contained in:
parent
9ebf6424ee
commit
1fcf96ad01
9 changed files with 35 additions and 52 deletions
|
@ -470,7 +470,7 @@ export function initRepoPullRequestReview() {
|
|||
assignMenuAttributes(form.find('.menu'));
|
||||
});
|
||||
|
||||
const $reviewBox = $('.review-box');
|
||||
const $reviewBox = $('.review-box-panel');
|
||||
if ($reviewBox.length === 1) {
|
||||
(async () => {
|
||||
// the editor's height is too large in some cases, and the panel cannot be scrolled with page now because there is `.repository .diff-detail-box.sticky { position: sticky; }`
|
||||
|
@ -487,12 +487,12 @@ export function initRepoPullRequestReview() {
|
|||
return;
|
||||
}
|
||||
|
||||
$('.btn-review').on('click', function (e) {
|
||||
$('.js-btn-review').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).closest('.dropdown').find('.menu').toggle('visible'); // eslint-disable-line
|
||||
}).closest('.dropdown').find('.close').on('click', function (e) {
|
||||
toggleElem($(this).parent().find('.review-box-panel'));
|
||||
}).parent().find('.review-box-panel .close').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).closest('.menu').toggle('visible'); // eslint-disable-line
|
||||
hideElem($(this).closest('.review-box-panel'));
|
||||
});
|
||||
|
||||
$(document).on('click', 'a.add-code-comment', async function (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue