fix dropdown issue, add autoprefix for scss
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
function setCookie(name, value, expireDays) {
|
||||
if (name == null) {
|
||||
return;
|
||||
}
|
||||
let extra = `; domain=${location.host}; path=/`;
|
||||
if (expireDays != null) {
|
||||
const d = new Date();
|
||||
@ -12,6 +15,9 @@ function setCookie(name, value, expireDays) {
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
name += '=';
|
||||
const cookies = document.cookie.split(';');
|
||||
for (let cookie of cookies) {
|
||||
|
@ -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')));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user