aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/features')
-rw-r--r--web_src/js/features/codeeditor.js1
-rw-r--r--web_src/js/features/repo-editor.js18
2 files changed, 11 insertions, 8 deletions
diff --git a/web_src/js/features/codeeditor.js b/web_src/js/features/codeeditor.js
index f5e4e74dc6..4dfef8c2b2 100644
--- a/web_src/js/features/codeeditor.js
+++ b/web_src/js/features/codeeditor.js
@@ -98,6 +98,7 @@ export async function createMonaco(textarea, filename, editorOpts) {
'input.foreground': getColor('--color-input-text'),
'scrollbar.shadow': getColor('--color-shadow'),
'progressBar.background': getColor('--color-primary'),
+ 'focusBorder': '#0000', // prevent blue border
},
});
diff --git a/web_src/js/features/repo-editor.js b/web_src/js/features/repo-editor.js
index 01dc4b95aa..a5232cb4b6 100644
--- a/web_src/js/features/repo-editor.js
+++ b/web_src/js/features/repo-editor.js
@@ -7,9 +7,9 @@ import {attachRefIssueContextPopup} from './contextpopup.js';
import {POST} from '../modules/fetch.js';
function initEditPreviewTab($form) {
- const $tabMenu = $form.find('.tabular.menu');
+ const $tabMenu = $form.find('.repo-editor-menu');
$tabMenu.find('.item').tab();
- const $previewTab = $tabMenu.find(`.item[data-tab="${$tabMenu.data('preview')}"]`);
+ const $previewTab = $tabMenu.find('a[data-tab="preview"]');
if ($previewTab.length) {
$previewTab.on('click', async function () {
const $this = $(this);
@@ -24,13 +24,15 @@ function initEditPreviewTab($form) {
const formData = new FormData();
formData.append('mode', mode);
formData.append('context', context);
- formData.append('text', $form.find(`.tab[data-tab="${$tabMenu.data('write')}"] textarea`).val());
+ formData.append('text', $form.find('.tab[data-tab="write"] textarea').val());
formData.append('file_path', $treePathEl.val());
try {
const response = await POST($this.data('url'), {data: formData});
const data = await response.text();
- const $previewPanel = $form.find(`.tab[data-tab="${$tabMenu.data('preview')}"]`);
- renderPreviewPanelContent($previewPanel, data);
+ const $previewPanel = $form.find('.tab[data-tab="preview"]');
+ if ($previewPanel.length) {
+ renderPreviewPanelContent($previewPanel, data);
+ }
} catch (error) {
console.error('Error:', error);
}
@@ -175,10 +177,10 @@ export function initRepoEditor() {
})();
}
-export function renderPreviewPanelContent($panelPreviewer, data) {
- $panelPreviewer.html(data);
+export function renderPreviewPanelContent($previewPanel, data) {
+ $previewPanel.html(data);
initMarkupContent();
- const $refIssues = $panelPreviewer.find('p .ref-issue');
+ const $refIssues = $previewPanel.find('p .ref-issue');
attachRefIssueContextPopup($refIssues);
}