Hide currentboard in selector (fixes #967)

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2019-04-10 17:17:19 +02:00
parent d9305fc347
commit 7ea0f70fe8
3 changed files with 16 additions and 6 deletions

View File

@@ -22,6 +22,11 @@
import app from '../app/App.js';
import Vue from 'vue';
Vue.prototype.t = t;
Vue.prototype.n = n;
Vue.prototype.OC = OC;
import CollaborationView from '../views/CollaborationView';
/* global oc_defaults oc_config OC OCP OCA */

View File

@@ -29,17 +29,18 @@ __webpack_nonce__ = btoa(OC.requestToken);
__webpack_public_path__ = OC.linkTo('deck', 'js/build/');
import Vue from 'vue';
Vue.prototype.$ = $
Vue.prototype.t = t
Vue.prototype.n = n
Vue.prototype.OC = OC
import BoardSelector from './views/BoardSelector';
import './../css/collections.css';
((function(OCP) {
Vue.prototype.$ = $
Vue.prototype.t = t
Vue.prototype.n = n
Vue.prototype.OC = OC
OCP.Collaboration.registerType('deck', {
action: () => {
return new Promise((resolve, reject) => {

View File

@@ -25,7 +25,7 @@
<div id="modal-inner" :class="{ 'icon-loading': loading }">
<h1>Select a board to add to the collection</h1>
<ul v-if="!loading">
<li v-for="board in boards" @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>{{ board.title }}</span>
</li>
@@ -84,10 +84,14 @@
boards: [],
selectedBoard: null,
loading: true,
currentBoard: null,
}
},
beforeMount() {
this.fetchBoards();
if (angular.element('#board')) {
this.currentBoard = angular.element('#board').scope().boardservice.id || null;
}
},
methods: {
fetchBoards() {