mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-02 04:00:36 +00:00
30 lines
594 B
JavaScript
30 lines
594 B
JavaScript
|
|
/* eslint-disable camelcase */
|
||
|
|
|
||
|
|
import { mapState } from 'client/libs/store';
|
||
|
|
|
||
|
|
export default {
|
||
|
|
computed: {
|
||
|
|
...mapState({
|
||
|
|
openedItemRows: 'openedItemRows',
|
||
|
|
}),
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
$_openedItemRows_toggleByType (typeId, add) {
|
||
|
|
let array = this.$store.state.openedItemRows;
|
||
|
|
|
||
|
|
if (add) {
|
||
|
|
array.push(typeId);
|
||
|
|
} else {
|
||
|
|
let index = array.indexOf(typeId);
|
||
|
|
|
||
|
|
if (index > -1) {
|
||
|
|
array.splice(index, 1);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
$_openedItemRows_isToggled (typeId) {
|
||
|
|
return this.openedItemRows.includes(typeId);
|
||
|
|
},
|
||
|
|
},
|
||
|
|
};
|