fix dropdown issue, add autoprefix for scss

This commit is contained in:
2023-03-31 22:19:51 +08:00
parent 41b1bbd7d6
commit 9677f6a82d
18 changed files with 2738 additions and 133 deletions

View File

@ -7,9 +7,9 @@ let cache;
function getCurrentLgId() {
let lgid;
if (typeof consts !== 'undefined') {
lgid = consts.cookie != null && getCookie(consts.cookie.lang);
lgid = getCookie(consts.cookie?.lang);
if (nullOrEmpty(lgid)) {
lgid = consts.user && consts.user.language;
lgid = consts.user?.language;
}
}
if (nullOrEmpty(lgid)) {
@ -83,7 +83,7 @@ function getLanguage(lgres, key, defaultValue) {
function applyLanguage(dom, result) {
dom ??= document.body;
for (let text of dom.querySelectorAll('[data-lgid]')) {
const key = text.getAttribute('data-lgid');
const key = text.dataset.lgid;
if (text.tagName === 'INPUT') {
text.value = getLanguage(result, key, text.value);
} else {
@ -91,11 +91,11 @@ function applyLanguage(dom, result) {
}
}
for (let title of dom.querySelectorAll('[data-title-lgid]')) {
const key = title.getAttribute('data-title-lgid');
const key = title.dataset.titleLgid;
title.setAttribute('title', getLanguage(result, key, title.getAttribute('title')));
}
for (let holder of dom.querySelectorAll('[data-placeholder-lgid]')) {
const key = holder.getAttribute('data-placeholder-lgid');
const key = holder.dataset.placeholderLgid;
holder.setAttribute('placeholder', getLanguage(result, key, holder.getAttribute('placeholder')));
}
}