Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
refactor(ui): Nest inputs under their labels
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Oct 9, 2022
1 parent 7e03e80 commit 32a3084
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions packages/userscript/source/ui/TimeControlSettingsUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,8 @@ export class TimeControlSettingsUi extends SettingsSectionUi {
}
});

element.append(input, label);
label.prepend(input);
element.append(input);

return element;
}
Expand Down Expand Up @@ -1015,7 +1016,8 @@ export class TimeControlSettingsUi extends SettingsSectionUi {
}
});

element.append(input, label);
label.prepend(input);
element.append(label);

return element;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/userscript/source/ui/TradeSettingsUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ export class TradeSettingsUi extends SettingsSectionUi {
}
});

element.append(input, label);
label.prepend(input);
element.append(label);

return element;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/userscript/source/ui/UserInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class UserInterface {
this._addRule(
`#ks ul li.ks-setting .ks-label {
display: inline-block;
min-width: 100px;
min-width: 120px;
}`
);
// Setting: +/- Expando Toggle
Expand Down
3 changes: 2 additions & 1 deletion packages/userscript/source/ui/components/LimitedButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export class LimitedButton extends UiComponent {
}
});

element.append(checkbox, elementLabel);
elementLabel.prepend(checkbox);
element.append(elementLabel);

setting.$limited = this;

Expand Down
3 changes: 2 additions & 1 deletion packages/userscript/source/ui/components/SettingListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export class SettingListItem extends UiComponent {
}
});

element.append(checkbox, elementLabel);
elementLabel.prepend(checkbox);
element.append(elementLabel);

setting.$enabled = this;

Expand Down

0 comments on commit 32a3084

Please sign in to comment.