mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +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() {
|
||||
#acontent {
|
||||
margin-right: calc(-1rem + 1px);
|
||||
padding-right: 1rem;
|
||||
padding-right: 1.25rem;
|
||||
}
|
||||
|
||||
// applies to playlist list page
|
||||
|
||||
@@ -10,7 +10,12 @@
|
||||
:key="index"
|
||||
: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 }}
|
||||
</div>
|
||||
<div class="options">
|
||||
|
||||
@@ -12,6 +12,7 @@ export interface Setting {
|
||||
inactive?: () => boolean;
|
||||
action: (arg0?: any) => void;
|
||||
source: () => any;
|
||||
defaultAction?: () => void;
|
||||
}
|
||||
|
||||
export interface SettingGroup {
|
||||
|
||||
@@ -22,6 +22,7 @@ const context_children_show_mode: Setting = {
|
||||
],
|
||||
source: () => settings().contextChildrenShowMode,
|
||||
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) {
|
||||
this.contextChildrenShowMode = mode;
|
||||
},
|
||||
toggleContextChildrenShowMode() {
|
||||
this.contextChildrenShowMode =
|
||||
this.contextChildrenShowMode === contextChildrenShowMode.click
|
||||
? contextChildrenShowMode.hover
|
||||
: contextChildrenShowMode.click;
|
||||
},
|
||||
},
|
||||
getters: {
|
||||
can_extend_width(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user