aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/comp
diff options
context:
space:
mode:
authorHester Gong <hestergong@gmail.com>2023-04-12 11:03:23 +0800
committerGitHub <noreply@github.com>2023-04-11 23:03:23 -0400
commitb43ad51a3dd28b747f7135f081d8812dedd89879 (patch)
tree33ec9a920e4c59aab5af240c7ee3b1875e63efc6 /web_src/js/features/comp
parent6892e2b8efff4465acd702e702d16f7aadd07187 (diff)
downloadgitea-b43ad51a3dd28b747f7135f081d8812dedd89879.tar.gz
gitea-b43ad51a3dd28b747f7135f081d8812dedd89879.zip
Add popup to hashed comments/pull requests/issues in file editing/adding preview tab (#24040)
#23734 didn't add popups(tippy) to ref issues for the preview tab when adding/editing a file The location of the preview tab: <img width="1214" alt="截屏2023-04-10 13 55 38" src="https://user-images.githubusercontent.com/17645053/230836213-a73f0cee-378c-4a21-93db-583ba2c72f77.png"> This PR resues the logic in `ComboMarkdownEditor.js` to also add popup to hashed comments/pull requests/issues in file editing/adding preview tab. After - On hover: <img width="1222" alt="截屏2023-04-10 13 55 42" src="https://user-images.githubusercontent.com/17645053/230836250-527ca7d0-6ec4-4c68-89ab-4f1b57b09239.png"> --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'web_src/js/features/comp')
-rw-r--r--web_src/js/features/comp/ComboMarkdownEditor.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/web_src/js/features/comp/ComboMarkdownEditor.js b/web_src/js/features/comp/ComboMarkdownEditor.js
index 7283dab35c..a7d69af7b4 100644
--- a/web_src/js/features/comp/ComboMarkdownEditor.js
+++ b/web_src/js/features/comp/ComboMarkdownEditor.js
@@ -4,10 +4,9 @@ import $ from 'jquery';
import {attachTribute} from '../tribute.js';
import {hideElem, showElem, autosize} from '../../utils/dom.js';
import {initEasyMDEImagePaste, initTextareaImagePaste} from './ImagePaste.js';
-import {initMarkupContent} from '../../markup/content.js';
import {handleGlobalEnterQuickSubmit} from './QuickSubmit.js';
-import {attachRefIssueContextPopup} from '../contextpopup.js';
import {emojiKeys, emojiString} from '../emoji.js';
+import {renderPreviewPanelContent} from '../repo-editor.js';
let elementIdCounter = 0;
const maxExpanderMatches = 6;
@@ -194,11 +193,7 @@ class ComboMarkdownEditor {
text: this.value(),
wiki: this.previewWiki,
}, (data) => {
- $panelPreviewer.html(data);
- initMarkupContent();
-
- const refIssues = $panelPreviewer.find('p .ref-issue');
- attachRefIssueContextPopup(refIssues);
+ renderPreviewPanelContent($panelPreviewer, data);
});
});
}