From 6d8dbeebcd8ef06e2df25ee1bd599d4cd1701b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 19 Jun 2017 12:18:15 +0200 Subject: [PATCH] Set board title as browser title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- js/app/Run.js | 1 + js/controller/BoardController.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/js/app/Run.js b/js/app/Run.js index 274f689a2..7d5294c28 100644 --- a/js/app/Run.js +++ b/js/app/Run.js @@ -30,6 +30,7 @@ app.run(function ($document, $rootScope, $transitions, BoardService) { }); $transitions.onEnter({to: 'list'}, function($state, $transition$) { BoardService.unsetCurrrent(); + document.title = "Deck - " + oc_defaults.name; }); $transitions.onEnter({to: 'board.card'}, function ($state, $transition$) { $rootScope.sidebar.show = true; diff --git a/js/controller/BoardController.js b/js/controller/BoardController.js index 46260f2eb..cc80f2ad3 100644 --- a/js/controller/BoardController.js +++ b/js/controller/BoardController.js @@ -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); });