Only try to access angular instance if we are currently in deck
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
<div id="modal-inner" :class="{ 'icon-loading': loading }">
|
<div id="modal-inner" :class="{ 'icon-loading': loading }">
|
||||||
<h1>{{ t('deck', 'Select the board to link to a project') }}</h1>
|
<h1>{{ t('deck', 'Select the board to link to a project') }}</h1>
|
||||||
<ul v-if="!loading">
|
<ul v-if="!loading">
|
||||||
<li v-for="board in boards" v-if="currentBoard && ''+board.id !== ''+currentBoard" @click="selectedBoard=board.id" :class="{'selected': (selectedBoard === board.id) }">
|
<li v-for="board in boards" v-if="!currentBoard || ''+board.id !== ''+currentBoard" @click="selectedBoard=board.id" :class="{'selected': (selectedBoard === board.id) }">
|
||||||
<span class="board-bullet" :style="{ 'backgroundColor': '#' + board.color }"></span>
|
<span class="board-bullet" :style="{ 'backgroundColor': '#' + board.color }"></span>
|
||||||
<span>{{ board.title }}</span>
|
<span>{{ board.title }}</span>
|
||||||
</li>
|
</li>
|
||||||
@@ -89,8 +89,10 @@
|
|||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
this.fetchBoards();
|
this.fetchBoards();
|
||||||
if (angular.element('#board')) {
|
if (typeof angular !== 'undefined' && angular.element('#board')) {
|
||||||
this.currentBoard = angular.element('#board').scope().boardservice.id || null;
|
try {
|
||||||
|
this.currentBoard = angular.element('#board').scope().boardservice.id || null;
|
||||||
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user