Make circles/collections depending on available version

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2019-03-28 18:46:37 +01:00
parent 8532db96e3
commit 29f6ae477b
2 changed files with 25 additions and 22 deletions

View File

@@ -151,28 +151,30 @@ app.controller('BoardController', function ($rootScope, $scope, $element, $state
} }
}); });
const ComponentVM = new Vue({ if (parseInt(oc_config.version.split('.')[0]) >= 16) {
render: h => h(CollaborationView), const ComponentVM = new Vue({
data: { render: h => h(CollaborationView),
model: BoardService.getCurrent() data: {
}, model: BoardService.getCurrent()
}); },
$scope.mountCollections = function() { });
const MountingPoint = document.getElementById('collaborationResources'); $scope.mountCollections = function () {
if (MountingPoint) { const MountingPoint = document.getElementById('collaborationResources');
if (MountingPoint) {
ComponentVM.model = BoardService.getCurrent();
ComponentVM.$mount(MountingPoint);
}
};
$scope.$$postDigest($scope.mountCollections);
$scope.$watch(function () {
return BoardService.getCurrent();
}, function () {
ComponentVM.model = BoardService.getCurrent(); ComponentVM.model = BoardService.getCurrent();
ComponentVM.$mount(MountingPoint); if ($scope.sidebar.show) {
} $scope.$$postDigest($scope.mountCollections);
}; }
$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() { $scope.toggleCompactMode = function() {
$rootScope.compactMode = !$rootScope.compactMode; $rootScope.compactMode = !$rootScope.compactMode;

View File

@@ -83,7 +83,8 @@ class PermissionService {
$this->config = $config; $this->config = $config;
$this->userId = $userId; $this->userId = $userId;
$this->circlesEnabled = \OC::$server->getAppManager()->isEnabledForUser('circles'); $this->circlesEnabled = \OC::$server->getAppManager()->isEnabledForUser('circles') &&
(version_compare(\OC::$server->getAppManager()->getAppVersion('circles'), '0.17.1') >= 0);
} }
/** /**