We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da3e85a commit 067eff8Copy full SHA for 067eff8
web_src/js/index.js
@@ -64,10 +64,16 @@ function initEditPreviewTab($form) {
64
previewFileModes = $previewTab.data('preview-file-modes').split(',');
65
$previewTab.on('click', function () {
66
const $this = $(this);
67
+ let context = `{$this.data('context')}/`;
68
+ const treePathEl = $form.find('input#tree_path');
69
+ if (treePathEl.length > 0) {
70
+ context += treePathEl.val();
71
+ }
72
+ context = context.substring(0, context.lastIndexOf('/'));
73
$.post($this.data('url'), {
74
_csrf: csrf,
75
mode: 'gfm',
- context: $this.data('context'),
76
+ context,
77
text: $form.find(`.tab.segment[data-tab="${$tabMenu.data('write')}"] textarea`).val()
78
}, (data) => {
79
const $previewPanel = $form.find(`.tab.segment[data-tab="${$tabMenu.data('preview')}"]`);
0 commit comments