Skip to content

Commit 00e372d

Browse files
committed
misc tweaks
1 parent d128812 commit 00e372d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

web_src/js/features/codeeditor.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ function getFileBasedOptions(filename, lineWrapExts) {
132132
}
133133

134134
function togglePreviewDisplay(previewable) {
135-
const previewTab = document.querySelector('a[data-tab=preview]');
136-
if (!previewTab) {
137-
return;
138-
}
135+
const previewTab = document.querySelector('a[data-tab="preview"]');
136+
if (!previewTab) return;
137+
139138
if (previewable) {
140139
const newUrl = (previewTab.getAttribute('data-url') || '').replace(/(.*)\/.*/i, `$1/markup`);
141140
previewTab.setAttribute('data-url', newUrl);
@@ -145,7 +144,7 @@ function togglePreviewDisplay(previewable) {
145144
// If the "preview" tab was active, user changes the filename to a non-previewable one,
146145
// then the "preview" tab becomes inactive (hidden), so the "write" tab should become active
147146
if (previewTab.classList.contains('active')) {
148-
const writeTab = document.querySelector('a[data-tab=write]');
147+
const writeTab = document.querySelector('a[data-tab="write"]');
149148
writeTab.click();
150149
}
151150
}

0 commit comments

Comments
 (0)