Implement collections integration

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2019-03-05 14:34:19 +01:00
parent 9149a01949
commit e2be00a18d
15 changed files with 982 additions and 158 deletions

View File

@@ -21,8 +21,11 @@
*/
import app from '../app/App.js';
import Vue from 'vue';
import CollaborationView from '../views/CollaborationView';
/* global oc_defaults OC OCP OCA */
app.controller('BoardController', function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions, $filter, FileService) {
app.controller('BoardController', function ($rootScope, $scope, $element, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions, $filter, FileService) {
$scope.sidebar = $rootScope.sidebar;
@@ -148,6 +151,31 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
}
});
const ComponentVM = new Vue({
render: h => h(CollaborationView),
data: {
model: BoardService.getCurrent()
},
});
$scope.mountCollections = () => {
console.log('mountCollections');
const MountingPoint = document.getElementById('collaborationResources');
if (MountingPoint) {
console.log(MountingPoint);
ComponentVM.model = BoardService.getCurrent();
ComponentVM.$mount(MountingPoint);
}
};
$scope.$$postDigest($scope.mountCollections);
$scope.$watch(function () {
return BoardService.getCurrent();
}, function() {
ComponentVM.model = BoardService.getCurrent();
if ($scope.sidebar.show) {
$scope.$$postDigest($scope.mountCollections);
}
});
$scope.toggleCompactMode = function() {
$rootScope.compactMode = !$rootScope.compactMode;
localStorage.setItem('deck.compactMode', JSON.stringify($rootScope.compactMode));