Skip to content

Commit

Permalink
fix syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Clemens-E committed Dec 12, 2023
1 parent cc2574f commit e025390
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions src/cm6/tooltipField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function contructTooltip(plugin: LanguageToolPlugin, view: EditorView, underline
const mainClass = plugin.settings.glassBg ? 'lt-predictions-container-glass' : 'lt-predictions-container';

return createDiv({ cls: [mainClass, getIssueTypeClassName(category)] }, root => {

if (title) {
root.createSpan({ cls: 'lt-title' }, span => {
span.createSpan({ text: title });
Expand Down Expand Up @@ -61,31 +60,31 @@ function contructTooltip(plugin: LanguageToolPlugin, view: EditorView, underline
}
});
}
bottom.createDiv({ cls: 'lt-info-container'}, infoContainer => {
bottom.createDiv({ cls: 'lt-info-container' }, infoContainer => {
infoContainer.createEl('button', { cls: 'lt-info-button clickable-icon' }, button => {
setIcon(button, 'info');
button.onclick = () => {
const popup = document.getElementsByClassName('lt-info-box').item(0);
if (!popup) {
throw Error("Programming error: failed to create popup. Please notify the LanguageTool maintainer if this problem persists.")
throw Error(
'Programming error: failed to create popup. Please notify the LanguageTool maintainer if this problem persists.',
);
}
if (popup.hasClass('hidden')) {
popup.removeClass('hidden');
} else {
popup.addClass('hidden');
}

};
})
});

infoContainer.createDiv({ cls: 'lt-info-box hidden' }, popup => {
// \u00A0 is a non-breaking space
popup.createDiv({ cls: 'lt-info', text: `Category:\u00A0${category}` });
popup.createDiv({ cls: 'lt-info', text: `Rule:\u00A0${ruleId}` });
})
});
});
})

});

root.createDiv({ cls: 'lt-ignorecontainer' }, container => {
container.createEl('button', { cls: 'lt-ignore-btn' }, button => {
Expand Down
2 changes: 1 addition & 1 deletion styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}

.lt-info-button {
color: var(--text-faint);
color: var(--text-faint);
}

.lt-info-box {
Expand Down

0 comments on commit e025390

Please sign in to comment.