Set board title as browser title

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2017-06-19 12:18:15 +02:00
parent 1d9a0d35d8
commit 6d8dbeebcd
2 changed files with 9 additions and 0 deletions

View File

@@ -45,6 +45,13 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
$scope.board = BoardService.getCurrent();
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();
@@ -115,6 +122,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
// Handle initial Loading
BoardService.fetchOne($scope.id).then(function (data) {
$scope.statusservice.releaseWaiting();
$scope.setPageTitle();
}, function (error) {
$scope.statusservice.setError('Error occured', error);
});