fix radio inline label

This commit is contained in:
zombieFox 2021-09-09 21:51:28 +01:00
parent 9801fdb733
commit 29ee1bdccf
2 changed files with 13 additions and 14 deletions

View File

@ -125,14 +125,8 @@ export const Control_radio = function({
const wrap = form.wrap(); const wrap = form.wrap();
if (label) { if (this.label) {
wrap.appendChild( wrap.appendChild(form.wrap({ children: [this.label] }));
form.wrap({
children: [
this.label
]
})
);
}; };
this.radioSet.forEach((item, i) => { this.radioSet.forEach((item, i) => {
@ -167,15 +161,13 @@ export const Control_radio = function({
this.inline = () => { this.inline = () => {
const formWrap = form.wrap(); const inline = form.inline({
const formInline = form.inline({
gap: 'large', gap: 'large',
wrap: true wrap: true
}); });
this.radioSet.forEach((item, i) => { this.radioSet.forEach((item, i) => {
formInline.appendChild( inline.appendChild(
form.wrap({ form.wrap({
children: [ children: [
item.radio, item.radio,
@ -185,9 +177,15 @@ export const Control_radio = function({
); );
}); });
formWrap.appendChild(formInline); const wrap = form.wrap();
return formWrap; if (this.label) {
wrap.appendChild(form.wrap({ children: [this.label] }));
};
wrap.appendChild(form.wrap({ children: [inline] }));
return wrap;
}; };

View File

@ -447,6 +447,7 @@ layoutSetting.page = (parent) => {
layoutSetting.control.page.scrollbar = new Control_radio({ layoutSetting.control.page.scrollbar = new Control_radio({
object: state.get.current(), object: state.get.current(),
label: 'Scrollbar',
radioGroup: [ radioGroup: [
{ id: 'layout-scrollbar-auto', labelText: 'Auto', value: 'auto' }, { id: 'layout-scrollbar-auto', labelText: 'Auto', value: 'auto' },
{ id: 'layout-scrollbar-thin', labelText: 'Thin', value: 'thin' }, { id: 'layout-scrollbar-thin', labelText: 'Thin', value: 'thin' },