complete strings
document, adjust structure
This commit is contained in:
@ -50,27 +50,42 @@ function createCheckbox(opts) {
|
||||
}
|
||||
|
||||
function resolveCheckbox(container, legacy) {
|
||||
if (container == null) {
|
||||
container = document.body;
|
||||
}
|
||||
if (legacy) {
|
||||
const checks = container.querySelectorAll('input[type="checkbox"]');
|
||||
for (let chk of checks) {
|
||||
if (chk.parentElement.querySelector('layer.check-box-inner') != null) {
|
||||
continue;
|
||||
}
|
||||
const id = chk.id;
|
||||
let label;
|
||||
let label, text;
|
||||
if (id != null) {
|
||||
label = container.querySelector(`label[for="${id}"]`);
|
||||
}
|
||||
if (label == null) {
|
||||
const e = chk.nextElementSibling;
|
||||
if (e != null && e.tagName === 'LABEL') {
|
||||
label = e;
|
||||
if (e != null) {
|
||||
if (e.tagName === 'LABEL') {
|
||||
label = e;
|
||||
} else if (e.tagName === 'SPAN' && e.getAttribute('data-lgid') != null) {
|
||||
text = e.innerText;
|
||||
e.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (label == null) {
|
||||
const e = chk.previousElementSibling;
|
||||
if (e != null && e.tagName === 'LABEL') {
|
||||
label = e;
|
||||
if (e != null) {
|
||||
if (e.tagName === 'LABEL') {
|
||||
label = e;
|
||||
} else if (text == null && e.tagName === 'SPAN' && e.getAttribute('data-lgid') != null) {
|
||||
text = e.innerText;
|
||||
e.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
let text;
|
||||
if (label == null) {
|
||||
label = document.createElement('label');
|
||||
chk.parentElement.insertBefore(label, chk);
|
||||
|
Reference in New Issue
Block a user