File tree 2 files changed +13
-10
lines changed
2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,9 @@ import $ from 'jquery';
4
4
import { attachTribute } from '../tribute.js' ;
5
5
import { hideElem , showElem , autosize } from '../../utils/dom.js' ;
6
6
import { initEasyMDEImagePaste , initTextareaImagePaste } from './ImagePaste.js' ;
7
- import { initMarkupContent } from '../../markup/content.js' ;
8
7
import { handleGlobalEnterQuickSubmit } from './QuickSubmit.js' ;
9
- import { attachRefIssueContextPopup } from '../contextpopup.js' ;
10
8
import { emojiKeys , emojiString } from '../emoji.js' ;
9
+ import { renderPreviewPanelContent } from '../repo-editor.js' ;
11
10
12
11
let elementIdCounter = 0 ;
13
12
const maxExpanderMatches = 6 ;
@@ -194,11 +193,7 @@ class ComboMarkdownEditor {
194
193
text : this . value ( ) ,
195
194
wiki : this . previewWiki ,
196
195
} , ( data ) => {
197
- $panelPreviewer . html ( data ) ;
198
- initMarkupContent ( ) ;
199
-
200
- const refIssues = $panelPreviewer . find ( 'p .ref-issue' ) ;
201
- attachRefIssueContextPopup ( refIssues ) ;
196
+ renderPreviewPanelContent ( $panelPreviewer , data ) ;
202
197
} ) ;
203
198
} ) ;
204
199
}
Original file line number Diff line number Diff line change 1
1
import $ from 'jquery' ;
2
2
import { htmlEscape } from 'escape-goat' ;
3
- import { initMarkupContent } from '../markup/content.js' ;
4
3
import { createCodeEditor } from './codeeditor.js' ;
5
4
import { hideElem , showElem } from '../utils/dom.js' ;
5
+ import { initMarkupContent } from '../markup/content.js' ;
6
+ import { attachRefIssueContextPopup } from './contextpopup.js' ;
6
7
7
8
const { csrfToken} = window . config ;
8
9
@@ -28,8 +29,7 @@ function initEditPreviewTab($form) {
28
29
file_path : treePathEl . val ( ) ,
29
30
} , ( data ) => {
30
31
const $previewPanel = $form . find ( `.tab[data-tab="${ $tabMenu . data ( 'preview' ) } "]` ) ;
31
- $previewPanel . html ( data ) ;
32
- initMarkupContent ( ) ;
32
+ renderPreviewPanelContent ( $previewPanel , data ) ;
33
33
} ) ;
34
34
} ) ;
35
35
}
@@ -191,3 +191,11 @@ export function initRepoEditor() {
191
191
} ) ;
192
192
} ) ( ) ;
193
193
}
194
+
195
+ export function renderPreviewPanelContent ( $panelPreviewer , data ) {
196
+ $panelPreviewer . html ( data ) ;
197
+ initMarkupContent ( ) ;
198
+
199
+ const refIssues = $panelPreviewer . find ( 'p .ref-issue' ) ;
200
+ attachRefIssueContextPopup ( refIssues ) ;
201
+ }
You can’t perform that action at this time.
0 commit comments