mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
add a default action to a setting: for text click
This commit is contained in:
committed by
Mungai Njoroge
parent
c1fb05e2a0
commit
6d84283efd
@@ -3,7 +3,7 @@
|
|||||||
@-moz-document url-prefix() {
|
@-moz-document url-prefix() {
|
||||||
#acontent {
|
#acontent {
|
||||||
margin-right: calc(-1rem + 1px);
|
margin-right: calc(-1rem + 1px);
|
||||||
padding-right: 1rem;
|
padding-right: 1.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
// applies to playlist list page
|
// applies to playlist list page
|
||||||
|
|||||||
@@ -10,7 +10,12 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
:class="{ inactive: setting.inactive && setting.inactive() }"
|
:class="{ inactive: setting.inactive && setting.inactive() }"
|
||||||
>
|
>
|
||||||
<div class="title ellip" @click="setting.action()">
|
<div
|
||||||
|
class="title ellip"
|
||||||
|
@click="
|
||||||
|
setting.defaultAction ? setting.defaultAction() : setting.action()
|
||||||
|
"
|
||||||
|
>
|
||||||
{{ setting.title }}
|
{{ setting.title }}
|
||||||
</div>
|
</div>
|
||||||
<div class="options">
|
<div class="options">
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export interface Setting {
|
|||||||
inactive?: () => boolean;
|
inactive?: () => boolean;
|
||||||
action: (arg0?: any) => void;
|
action: (arg0?: any) => void;
|
||||||
source: () => any;
|
source: () => any;
|
||||||
|
defaultAction?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SettingGroup {
|
export interface SettingGroup {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ const context_children_show_mode: Setting = {
|
|||||||
],
|
],
|
||||||
source: () => settings().contextChildrenShowMode,
|
source: () => settings().contextChildrenShowMode,
|
||||||
action: (value: mode) => settings().setContextChildrenShowMode(value),
|
action: (value: mode) => settings().setContextChildrenShowMode(value),
|
||||||
|
defaultAction: () => settings().toggleContextChildrenShowMode(),
|
||||||
};
|
};
|
||||||
|
|
||||||
export default [context_children_show_mode];
|
export default [context_children_show_mode];
|
||||||
@@ -23,6 +23,12 @@ export default defineStore("settings", {
|
|||||||
setContextChildrenShowMode(mode: contextChildrenShowMode) {
|
setContextChildrenShowMode(mode: contextChildrenShowMode) {
|
||||||
this.contextChildrenShowMode = mode;
|
this.contextChildrenShowMode = mode;
|
||||||
},
|
},
|
||||||
|
toggleContextChildrenShowMode() {
|
||||||
|
this.contextChildrenShowMode =
|
||||||
|
this.contextChildrenShowMode === contextChildrenShowMode.click
|
||||||
|
? contextChildrenShowMode.hover
|
||||||
|
: contextChildrenShowMode.click;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
can_extend_width(): boolean {
|
can_extend_width(): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user