chore: review changes
This commit is contained in:
parent
baff4de406
commit
2da62b2e94
4 changed files with 9 additions and 10 deletions
|
@ -6,8 +6,8 @@
|
|||
<div class="icons">
|
||||
<RadioButtons
|
||||
:text-strings="timeFormatTextStrings"
|
||||
:default-button-key='settingsLoad().timeFormat ?? "Auto"'
|
||||
:callback="(index: number) => {settingSave('timeFormat', timeFormatTextStrings[index])}"
|
||||
:default-button-key='settingsLoad().timeFormat || "Auto"'
|
||||
:callback="(index: number) => { settingSave('timeFormat', timeFormatTextStrings[index]) }"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ onMounted(async () => {
|
|||
const children = radioButtonsContainer.value.children
|
||||
|
||||
// set the button based on key
|
||||
if (props.defaultButtonKey != undefined) {
|
||||
if (props.defaultButtonKey) {
|
||||
const newIndex = props.textStrings.indexOf(props.defaultButtonKey)
|
||||
const defaultButton = children.item(newIndex)
|
||||
if (defaultButton) {
|
||||
|
@ -49,10 +49,9 @@ function onClick(clickedIndex: number) {
|
|||
if (radioButtonsContainer.value) {
|
||||
// remove selected-radio-button class from all buttons except the clicked one
|
||||
const children = radioButtonsContainer.value.children
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const button = children.item(i)
|
||||
for (const button of children) {
|
||||
if (button) {
|
||||
unSelectButton(button)
|
||||
unselectButton(button)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +64,7 @@ function onClick(clickedIndex: number) {
|
|||
props.callback(clickedIndex)
|
||||
}
|
||||
|
||||
function unSelectButton(button: Element) {
|
||||
function unselectButton(button: Element) {
|
||||
button.classList.remove("selected-radio-button")
|
||||
button.children.item(0)?.classList.remove("selected-radio-button-radio")
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export default (): "12" | "24" => {
|
||||
const format = settingsLoad().timeFormat ?? "Auto"
|
||||
const format = settingsLoad().timeFormat || "Auto"
|
||||
|
||||
if (format == "4:18 PM") {
|
||||
return "12"
|
||||
|
|
|
@ -6,13 +6,13 @@ export default () => {
|
|||
const runtimeConfig = useRuntimeConfig()
|
||||
const baseURL = runtimeConfig.app.baseURL;
|
||||
|
||||
let currentStyle = settingsLoad().selectedThemeStyle ?? (
|
||||
let currentStyle = settingsLoad().selectedThemeStyle || (
|
||||
prefersLight()
|
||||
? `${baseURL}themes/style/light.css`
|
||||
: `${baseURL}themes/style/dark.css`
|
||||
);
|
||||
|
||||
let currentLayout = settingsLoad().selectedThemeLayout ?? `${baseURL}themes/layout/gorb.css`
|
||||
let currentLayout = settingsLoad().selectedThemeLayout || `${baseURL}themes/layout/gorb.css`
|
||||
|
||||
if (styleLinkElement) {
|
||||
styleLinkElement.href = currentStyle;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue