From 459e117d28b1874579dbec5cb3024de46dd35826 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Mon, 30 Sep 2013 11:02:57 -0700 Subject: [PATCH] Added route change when saving to elasticsearch or browser default --- src/app/services/dashboard.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/services/dashboard.js b/src/app/services/dashboard.js index c72601c682e83..477354e8ab3ef 100755 --- a/src/app/services/dashboard.js +++ b/src/app/services/dashboard.js @@ -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 @@ -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; @@ -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