feat(note_language): display checkbox to the right

This commit is contained in:
Elian Doran
2025-03-04 21:31:19 +02:00
parent d31ba6f47c
commit 9f6b97cdfa
2 changed files with 10 additions and 4 deletions

View File

@@ -19,6 +19,10 @@ const TPL = `\
.note-language-dropdown [dir=rtl] {
text-align: right;
}
.dropdown-item.rtl > .check {
order: 1;
}
</style>
</div>
`;
@@ -77,9 +81,6 @@ export default class NoteLanguageWidget extends NoteContextAwareWidget {
for (const locale of this.locales) {
if (typeof locale === "object") {
const $title = $("<span>").text(locale.name);
if (locale.rtl) {
$title.attr("dir", "rtl");
}
const $link = $('<a class="dropdown-item">')
.attr("data-language", locale.id)
@@ -90,6 +91,10 @@ export default class NoteLanguageWidget extends NoteContextAwareWidget {
this.save(languageId);
});
if (locale.rtl) {
$link.attr("dir", "rtl");
}
if (locale.id === this.currentLanguageId) {
$link.addClass("selected");
}