diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-24 18:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-24 18:10:36 +0300 |
commit | 234dc40a12a1cdaef0cdb825ca4acc3f271c6394 (patch) | |
tree | fb9875dca8b558acafa54c36a591b4d2ed10fc49 /app/assets/javascripts/ide | |
parent | c7864d3d50b4002c621c7cba2e1ebfb5d23ac7ed (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/ide')
-rw-r--r-- | app/assets/javascripts/ide/components/repo_editor.vue | 6 | ||||
-rw-r--r-- | app/assets/javascripts/ide/index.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/ide/stores/state.js | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/ide/components/repo_editor.vue b/app/assets/javascripts/ide/components/repo_editor.vue index 2f990280367..2bf99550bf2 100644 --- a/app/assets/javascripts/ide/components/repo_editor.vue +++ b/app/assets/javascripts/ide/components/repo_editor.vue @@ -79,6 +79,7 @@ export default { 'editorTheme', 'entries', 'currentProjectId', + 'previewMarkdownPath', ]), ...mapGetters([ 'getAlert', @@ -314,14 +315,15 @@ export default { if ( this.fileType === MARKDOWN_FILE_TYPE && - this.editor?.getEditorType() === EDITOR_TYPE_CODE + this.editor?.getEditorType() === EDITOR_TYPE_CODE && + this.previewMarkdownPath ) { import('~/editor/extensions/source_editor_markdown_ext') .then(({ EditorMarkdownExtension: MarkdownExtension } = {}) => { this.editor.use( new MarkdownExtension({ instance: this.editor, - projectPath: this.currentProjectId, + previewMarkdownPath: this.previewMarkdownPath, }), ); }) diff --git a/app/assets/javascripts/ide/index.js b/app/assets/javascripts/ide/index.js index e8c726d6184..bdffed70882 100644 --- a/app/assets/javascripts/ide/index.js +++ b/app/assets/javascripts/ide/index.js @@ -63,6 +63,7 @@ export function initIde(el, options = {}) { editorTheme: window.gon?.user_color_scheme || DEFAULT_THEME, codesandboxBundlerUrl: el.dataset.codesandboxBundlerUrl, environmentsGuidanceAlertDismissed: !parseBoolean(el.dataset.enableEnvironmentsGuidance), + previewMarkdownPath: el.dataset.previewMarkdownPath, }); }, beforeDestroy() { diff --git a/app/assets/javascripts/ide/stores/state.js b/app/assets/javascripts/ide/stores/state.js index 83551e87f09..526987c750a 100644 --- a/app/assets/javascripts/ide/stores/state.js +++ b/app/assets/javascripts/ide/stores/state.js @@ -32,4 +32,5 @@ export default () => ({ codesandboxBundlerUrl: null, environmentsGuidanceAlertDismissed: false, environmentsGuidanceAlertDetected: false, + previewMarkdownPath: '', }); |