Fix angular dependency in board selector

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2019-10-24 16:04:18 +02:00
parent 9c8f5d5f63
commit 56bee425b9
4 changed files with 10 additions and 20 deletions

View File

@@ -25,7 +25,8 @@
<div id="modal-inner" :class="{ 'icon-loading': loading }">
<h1>{{ t('deck', 'Select the board to link to a project') }}</h1>
<ul v-if="!loading">
<li v-for="board in boards" v-if="!currentBoard || ''+board.id !== ''+currentBoard" :class="{'selected': (selectedBoard === board.id) }"
<li v-for="board in boards" v-if="!currentBoard || ''+board.id !== ''+currentBoard" :key="board.id"
:class="{'selected': (selectedBoard === board.id) }"
@click="selectedBoard=board.id">
<span :style="{ 'backgroundColor': '#' + board.color }" class="board-bullet" />
<span>{{ board.title }}</span>
@@ -87,17 +88,10 @@ export default {
loading: true,
currentBoard: null
}
},
computed: {
},
beforeMount() {
this.fetchBoards()
if (typeof angular !== 'undefined' && angular.element('#board')) {
try {
this.currentBoard = angular.element('#board').scope().boardservice.id || null
} catch (e) {}
}
this.currentBoard = window.location.hash.match(/\/boards\/([0-9]+)/)[1] || null
},
methods: {
fetchBoards() {
@@ -111,7 +105,6 @@ export default {
},
select() {
this.$root.$emit('select', this.selectedBoard)
}
}