Merge pull request #191 from nextcloud/browser-title

Set board title as browser title
This commit is contained in:
Marin Treselj
2017-06-19 21:02:07 +02:00
committed by GitHub
2 changed files with 9 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ app.run(function ($document, $rootScope, $transitions, BoardService) {
}); });
$transitions.onEnter({to: 'list'}, function($state, $transition$) { $transitions.onEnter({to: 'list'}, function($state, $transition$) {
BoardService.unsetCurrrent(); BoardService.unsetCurrrent();
document.title = "Deck - " + oc_defaults.name;
}); });
$transitions.onEnter({to: 'board.card'}, function ($state, $transition$) { $transitions.onEnter({to: 'board.card'}, function ($state, $transition$) {
$rootScope.sidebar.show = true; $rootScope.sidebar.show = true;

View File

@@ -45,6 +45,13 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
$scope.board = BoardService.getCurrent(); $scope.board = BoardService.getCurrent();
StackService.clear(); //FIXME: Is this still needed? StackService.clear(); //FIXME: Is this still needed?
$scope.setPageTitle = function() {
if(BoardService.getCurrent()) {
document.title = BoardService.getCurrent().title + " | Deck - " + oc_defaults.name;
} else {
document.title = "Deck - " + oc_defaults.name;
}
};
$scope.statusservice.retainWaiting(); $scope.statusservice.retainWaiting();
$scope.statusservice.retainWaiting(); $scope.statusservice.retainWaiting();
@@ -115,6 +122,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
// Handle initial Loading // Handle initial Loading
BoardService.fetchOne($scope.id).then(function (data) { BoardService.fetchOne($scope.id).then(function (data) {
$scope.statusservice.releaseWaiting(); $scope.statusservice.releaseWaiting();
$scope.setPageTitle();
}, function (error) { }, function (error) {
$scope.statusservice.setError('Error occured', error); $scope.statusservice.setError('Error occured', error);
}); });