Skip to content

Commit

Permalink
Merge pull request elastic#58 from spalger/useDocTitle
Browse files Browse the repository at this point in the history
Use doc title service to set tab title
  • Loading branch information
Rashid Khan committed Feb 3, 2016
2 parents d03729c + 360a88d commit 3349096
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require('./directives/docs');
require('./main.less');

var timelionLogo = require('plugins/timelion/header.png');
document.title = 'Timelion - Kibana';

require('ui/chrome')
.setBrand({
Expand Down Expand Up @@ -53,6 +54,8 @@ app.controller('timelion', function (
});

var timezone = Private(require('plugins/timelion/services/timezone'))();
var docTitle = Private(require('ui/doc_title'));

var defaultExpression = '.es(*)';
var savedSheet = $route.current.locals.savedSheet;
var blankSheet = [defaultExpression];
Expand Down Expand Up @@ -119,6 +122,10 @@ app.controller('timelion', function (
$scope.state.otherInterval = oldInterval;
});

$scope.$watch(function () { return savedSheet.title; }, function (newTitle) {
docTitle.change(savedSheet.id ? newTitle : undefined);
});

$scope.drop = function (item, partFrom, partTo, indexFrom, indexTo) {
$scope.state.selected = indexTo;
_.move($scope.sheet, indexFrom, indexTo);
Expand Down

0 comments on commit 3349096

Please sign in to comment.