Skip to content

Commit

Permalink
Added route change when saving to elasticsearch or browser default
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Sep 30, 2013
1 parent 37d212c commit 459e117
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/services/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {

var module = angular.module('kibana.services');

module.service('dashboard', function($routeParams, $http, $rootScope, $injector,
module.service('dashboard', function($routeParams, $http, $rootScope, $injector, $location,
ejsResource, timer, kbnIndex, alertSrv
) {
// A hash of defaults to use when loading a dashboard
Expand Down Expand Up @@ -206,6 +206,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
this.set_default = function(dashboard) {
if (Modernizr.localstorage) {
window.localStorage['dashboard'] = angular.toJson(dashboard || self.current);
$location.path('/dashboard');
return true;
} else {
return false;
Expand Down Expand Up @@ -331,6 +332,9 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
return request.doIndex(
// Success
function(result) {
if(type === 'dashboard') {
$location.path('/dashboard/elasticsearch/'+title);
}
return result;
},
// Failure
Expand Down

0 comments on commit 459e117

Please sign in to comment.