mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-03 13:33:32 +01:00
22 lines
749 B
JavaScript
22 lines
749 B
JavaScript
angular
|
|
.module('bit.directives')
|
|
|
|
.directive('pageTitle', function ($rootScope, $timeout, appSettings) {
|
|
return {
|
|
link: function (scope, element) {
|
|
var listener = function (event, toState, toParams, fromState, fromParams) {
|
|
// Default title
|
|
var title = 'bitwarden Web Vault';
|
|
if (toState.data && toState.data.pageTitle) {
|
|
title = toState.data.pageTitle + ' - ' + title;
|
|
}
|
|
|
|
$timeout(function () {
|
|
element.text(title);
|
|
});
|
|
};
|
|
|
|
$rootScope.$on('$stateChangeStart', listener);
|
|
}
|
|
};
|
|
}); |