summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/repo-issue.js
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-03-17 14:52:04 -0400
committerGitHub <noreply@github.com>2023-03-17 14:52:04 -0400
commit4b763d8d37628f49c610760fd694540cab3b2ceb (patch)
tree0b5f659dfbaf6bd18043a642132086d6e5bf2ff5 /web_src/js/features/repo-issue.js
parent1254fc668a8253ac4e4f7ce5193f49a02b1340ad (diff)
downloadgitea-4b763d8d37628f49c610760fd694540cab3b2ceb.tar.gz
gitea-4b763d8d37628f49c610760fd694540cab3b2ceb.zip
Fix diff detail buttons wrapping, use tippy for review box (#23271) (#23546)
Backport #23271 by @silverwind Fix visual regression introduced by https://github.com/go-gitea/gitea/pull/22986. Before: <img width="1277" alt="image" src="https://user-images.githubusercontent.com/115237/222792814-d70c2173-0c7c-4db2-8839-95be63cdc8ee.png"> <img width="649" alt="image" src="https://user-images.githubusercontent.com/115237/222792989-9b1f5e12-becd-40cc-b02c-e9f59a8e72a4.png"> After: <img width="1274" alt="image" src="https://user-images.githubusercontent.com/115237/222792769-e7a9702f-4b6a-46c4-9385-da103ed4dff0.png"> <img width="565" alt="image" src="https://user-images.githubusercontent.com/115237/222793084-6de6482b-11dc-4d38-b514-15884d20e140.png"> Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'web_src/js/features/repo-issue.js')
-rw-r--r--web_src/js/features/repo-issue.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js
index 4163fb120e..2b283b3c24 100644
--- a/web_src/js/features/repo-issue.js
+++ b/web_src/js/features/repo-issue.js
@@ -4,7 +4,7 @@ import {attachTribute} from './tribute.js';
import {createCommentEasyMDE, getAttachedEasyMDE} from './comp/EasyMDE.js';
import {initEasyMDEImagePaste} from './comp/ImagePaste.js';
import {initCompMarkupContentPreviewTab} from './comp/MarkupContentPreview.js';
-import {initTooltip, showTemporaryTooltip} from '../modules/tippy.js';
+import {initTooltip, showTemporaryTooltip, createTippy} from '../modules/tippy.js';
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
const {appSubUrl, csrfToken} = window.config;
@@ -491,12 +491,23 @@ export function initRepoPullRequestReview() {
return;
}
- $('.js-btn-review').on('click', function (e) {
- e.preventDefault();
- toggleElem($(this).parent().find('.review-box-panel'));
- }).parent().find('.review-box-panel .close').on('click', function (e) {
+ const $reviewBtn = $('.js-btn-review');
+ const $panel = $reviewBtn.parent().find('.review-box-panel');
+ const $closeBtn = $panel.find('.close');
+
+ const tippy = createTippy($reviewBtn[0], {
+ content: $panel[0],
+ placement: 'bottom',
+ trigger: 'click',
+ role: 'menu',
+ maxWidth: 'none',
+ interactive: true,
+ hideOnClick: true,
+ });
+
+ $closeBtn.on('click', (e) => {
e.preventDefault();
- hideElem($(this).closest('.review-box-panel'));
+ tippy.hide();
});
$(document).on('click', 'a.add-code-comment', async function (e) {