2019-07-30 08:49:32 -05:00
|
|
|
import angular, { IQService, ILocationService } from 'angular';
|
2019-01-23 05:52:46 -06:00
|
|
|
import { ChangeTracker } from './ChangeTracker';
|
2019-07-30 08:49:32 -05:00
|
|
|
import { ContextSrv } from 'app/core/services/context_srv';
|
|
|
|
import { DashboardSrv } from './DashboardSrv';
|
2017-12-21 06:22:20 -06:00
|
|
|
|
|
|
|
/** @ngInject */
|
2019-07-30 08:49:32 -05:00
|
|
|
export function unsavedChangesSrv(
|
|
|
|
this: any,
|
|
|
|
$rootScope: any,
|
|
|
|
$q: IQService,
|
|
|
|
$location: ILocationService,
|
|
|
|
$timeout: any,
|
|
|
|
contextSrv: ContextSrv,
|
|
|
|
dashboardSrv: DashboardSrv,
|
|
|
|
$window: any
|
|
|
|
) {
|
|
|
|
this.init = function(dashboard: any, scope: any) {
|
2018-04-17 02:41:07 -05:00
|
|
|
this.tracker = new ChangeTracker(dashboard, scope, 1000, $location, $window, $timeout, contextSrv, $rootScope);
|
2017-12-21 06:22:20 -06:00
|
|
|
return this.tracker;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-12-26 05:26:50 -06:00
|
|
|
angular.module('grafana.services').service('unsavedChangesSrv', unsavedChangesSrv);
|