summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/repo-editor.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/features/repo-editor.js')
-rw-r--r--web_src/js/features/repo-editor.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/web_src/js/features/repo-editor.js b/web_src/js/features/repo-editor.js
index a7c59fb039..b7937cf006 100644
--- a/web_src/js/features/repo-editor.js
+++ b/web_src/js/features/repo-editor.js
@@ -1,8 +1,9 @@
import $ from 'jquery';
import {htmlEscape} from 'escape-goat';
-import {initMarkupContent} from '../markup/content.js';
import {createCodeEditor} from './codeeditor.js';
import {hideElem, showElem} from '../utils/dom.js';
+import {initMarkupContent} from '../markup/content.js';
+import {attachRefIssueContextPopup} from './contextpopup.js';
const {csrfToken} = window.config;
@@ -28,8 +29,7 @@ function initEditPreviewTab($form) {
file_path: treePathEl.val(),
}, (data) => {
const $previewPanel = $form.find(`.tab[data-tab="${$tabMenu.data('preview')}"]`);
- $previewPanel.html(data);
- initMarkupContent();
+ renderPreviewPanelContent($previewPanel, data);
});
});
}
@@ -191,3 +191,11 @@ export function initRepoEditor() {
});
})();
}
+
+export function renderPreviewPanelContent($panelPreviewer, data) {
+ $panelPreviewer.html(data);
+ initMarkupContent();
+
+ const refIssues = $panelPreviewer.find('p .ref-issue');
+ attachRefIssueContextPopup(refIssues);
+}