mirror of
https://github.com/Lissy93/dashy.git
synced 2024-12-01 04:33:02 +03:00
🚧 WIP, redo layout and size, to use VueX state
This commit is contained in:
parent
06d08a8fff
commit
b882a38950
@ -25,6 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import StoreKeys from '@/utils/StoreMutations';
|
||||
import IconSmall from '@/assets/interface-icons/icon-size-small.svg';
|
||||
import IconMedium from '@/assets/interface-icons/icon-size-medium.svg';
|
||||
import IconLarge from '@/assets/interface-icons/icon-size-large.svg';
|
||||
@ -47,6 +48,7 @@ export default {
|
||||
methods: {
|
||||
updateIconSize(iconSize) {
|
||||
this.$emit('iconSizeUpdated', iconSize);
|
||||
this.$store.commit(StoreKeys.SET_ITEM_SIZE, iconSize);
|
||||
},
|
||||
tooltip(content) {
|
||||
return { content, trigger: 'hover focus', delay: 250 };
|
||||
|
@ -25,6 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import StoreKeys from '@/utils/StoreMutations';
|
||||
import IconDeafault from '@/assets/interface-icons/layout-default.svg';
|
||||
import IconHorizontal from '@/assets/interface-icons/layout-horizontal.svg';
|
||||
import IconVertical from '@/assets/interface-icons/layout-vertical.svg';
|
||||
@ -47,6 +48,7 @@ export default {
|
||||
methods: {
|
||||
updateDisplayLayout(layout) {
|
||||
this.$emit('layoutUpdated', layout);
|
||||
this.$store.commit(StoreKeys.SET_ITEM_LAYOUT, layout);
|
||||
},
|
||||
tooltip(content) {
|
||||
return { content, trigger: 'hover focus', delay: 250 };
|
||||
|
@ -14,6 +14,8 @@ const {
|
||||
UPDATE_CONFIG,
|
||||
SET_MODAL_OPEN,
|
||||
SET_LANGUAGE,
|
||||
SET_ITEM_LAYOUT,
|
||||
SET_ITEM_SIZE,
|
||||
UPDATE_ITEM,
|
||||
SET_EDIT_MODE,
|
||||
UPDATE_PAGE_INFO,
|
||||
@ -164,6 +166,12 @@ const store = new Vuex.Store({
|
||||
});
|
||||
state.config = config;
|
||||
},
|
||||
[SET_ITEM_LAYOUT](state, layout) {
|
||||
state.config.appConfig.layout = layout;
|
||||
},
|
||||
[SET_ITEM_SIZE](state, iconSize) {
|
||||
state.config.appConfig.iconSize = iconSize;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
/* Called when app first loaded. Reads config and sets state */
|
||||
|
@ -5,6 +5,8 @@ const KEY_NAMES = [
|
||||
'SET_MODAL_OPEN',
|
||||
'SET_LANGUAGE',
|
||||
'SET_EDIT_MODE',
|
||||
'SET_ITEM_LAYOUT',
|
||||
'SET_ITEM_SIZE',
|
||||
'UPDATE_ITEM',
|
||||
'UPDATE_PAGE_INFO',
|
||||
'UPDATE_APP_CONFIG',
|
||||
|
Loading…
Reference in New Issue
Block a user