mirror of
https://github.com/romancm/gamebrary
synced 2025-02-25 11:17:10 +00:00
Gameboard clean up
This commit is contained in:
parent
652cf28b99
commit
37a0692783
9 changed files with 74 additions and 50 deletions
|
@ -38,7 +38,7 @@
|
|||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import Tag from '@/components/Tags/Tag';
|
||||
import Tag from '@/components/Tag';
|
||||
import Modal from '@/components/Modal';
|
||||
|
||||
export default {
|
61
src/components/GameBoard/GameModal.vue
Normal file
61
src/components/GameBoard/GameModal.vue
Normal file
|
@ -0,0 +1,61 @@
|
|||
<template lang="html">
|
||||
<modal
|
||||
ref="game"
|
||||
large
|
||||
@close="closeGame"
|
||||
>
|
||||
<game
|
||||
v-if="gameDetailId"
|
||||
slot="content"
|
||||
:id="gameDetailId"
|
||||
:list-id="gameDetailListIndex"
|
||||
/>
|
||||
</modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Modal from '@/components/Modal';
|
||||
import Game from '@/pages/Game';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Modal,
|
||||
Game,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
gameDetailId: null,
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$bus.$on('OPEN_GAME', this.openGame);
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.$bus.$off('OPEN_GAME');
|
||||
},
|
||||
|
||||
methods: {
|
||||
closeGame() {
|
||||
this.setPageTitle();
|
||||
this.gameDetailId = null;
|
||||
this.$store.commit('CLEAR_ACTIVE_GAME');
|
||||
},
|
||||
|
||||
setPageTitle() {
|
||||
document.title = this.platform ? `${this.platform.name} - Gamebrary` : 'Gamebrary';
|
||||
},
|
||||
|
||||
openGame({ id, listId }) {
|
||||
this.gameDetailId = id;
|
||||
this.gameDetailListIndex = listId;
|
||||
this.$refs.game.open();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" rel="stylesheet/scss" scoped>
|
||||
</style>
|
|
@ -53,7 +53,7 @@
|
|||
<script>
|
||||
import GameRating from '@/components/GameDetail/GameRating';
|
||||
import GameCardUtils from '@/components/GameCards/GameCard';
|
||||
import Tag from '@/components/Tags/Tag';
|
||||
import Tag from '@/components/Tag';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<script>
|
||||
import GameRating from '@/components/GameDetail/GameRating';
|
||||
import GameCardUtils from '@/components/GameCards/GameCard';
|
||||
import Tag from '@/components/Tags/Tag';
|
||||
import Tag from '@/components/Tag';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<script>
|
||||
import GameRating from '@/components/GameDetail/GameRating';
|
||||
import GameCardUtils from '@/components/GameCards/GameCard';
|
||||
import Tag from '@/components/Tags/Tag';
|
||||
import Tag from '@/components/Tag';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Tag from '@/components/Tags/Tag';
|
||||
import Tag from '@/components/Tag';
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
|
||||
<script>
|
||||
import ToggleSwitch from '@/components/ToggleSwitch';
|
||||
import Tag from '@/components/Tags/Tag';
|
||||
import Tag from '@/components/Tag';
|
||||
import Modal from '@/components/Modal';
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
|
|
|
@ -1,21 +1,6 @@
|
|||
<template lang="html">
|
||||
<div v-if="loaded" class="game-board" >
|
||||
<game-board-placeholder v-if="loading" :id="gameDetailId" />
|
||||
|
||||
<modal
|
||||
ref="game"
|
||||
large
|
||||
@close="closeGame"
|
||||
>
|
||||
<game
|
||||
v-if="gameDetailId"
|
||||
slot="content"
|
||||
:id="gameDetailId"
|
||||
:list-id="gameDetailListIndex"
|
||||
/>
|
||||
</modal>
|
||||
|
||||
<apply-tag />
|
||||
<game-board-placeholder v-if="loading" />
|
||||
|
||||
<list
|
||||
v-for="(list, listIndex) in gameLists[platform.code]"
|
||||
|
@ -28,16 +13,17 @@
|
|||
/>
|
||||
|
||||
<list-add />
|
||||
<game-modal />
|
||||
<apply-tag-modal />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import GameBoardPlaceholder from '@/components/GameBoard/GameBoardPlaceholder';
|
||||
import ListAdd from '@/components/Lists/ListAdd';
|
||||
import ApplyTag from '@/components/Tags/ApplyTag';
|
||||
import Modal from '@/components/Modal';
|
||||
import ApplyTagModal from '@/components/GameBoard/ApplyTagModal';
|
||||
import GameModal from '@/components/GameBoard/GameModal';
|
||||
import List from '@/components/Lists/List';
|
||||
import Game from '@/pages/Game';
|
||||
import { chunk } from 'lodash';
|
||||
import { mapState } from 'vuex';
|
||||
import draggable from 'vuedraggable';
|
||||
|
@ -48,9 +34,8 @@ export default {
|
|||
List,
|
||||
GameBoardPlaceholder,
|
||||
ListAdd,
|
||||
ApplyTag,
|
||||
Game,
|
||||
Modal,
|
||||
ApplyTagModal,
|
||||
GameModal,
|
||||
},
|
||||
|
||||
data() {
|
||||
|
@ -60,7 +45,6 @@ export default {
|
|||
loading: false,
|
||||
gameData: null,
|
||||
gameDetailListIndex: null,
|
||||
gameDetailId: null,
|
||||
queryLimit: 500,
|
||||
};
|
||||
},
|
||||
|
@ -86,30 +70,9 @@ export default {
|
|||
}
|
||||
|
||||
this.load();
|
||||
this.setPageTitle();
|
||||
this.$bus.$on('OPEN_GAME', this.openGame);
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.$bus.$off('OPEN_GAME');
|
||||
},
|
||||
|
||||
methods: {
|
||||
closeGame() {
|
||||
this.setPageTitle();
|
||||
this.gameDetailId = null;
|
||||
this.$store.commit('CLEAR_ACTIVE_GAME');
|
||||
},
|
||||
|
||||
setPageTitle() {
|
||||
document.title = this.platform ? `${this.platform.name} - Gamebrary` : 'Gamebrary';
|
||||
},
|
||||
|
||||
openGame({ id, listId }) {
|
||||
this.gameDetailId = id;
|
||||
this.gameDetailListIndex = listId;
|
||||
this.$refs.game.open();
|
||||
},
|
||||
|
||||
dragEnd() {
|
||||
this.dragging = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue