Skip to content

Commit

Permalink
fix: fixed save to file button in export modal, fixes #9586
Browse files Browse the repository at this point in the history
(cherry picked from commit 1e61eae)
  • Loading branch information
torkelo committed Oct 19, 2017
1 parent aec448f commit 7fe1ac5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions public/app/features/dashboard/export/export_modal.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
///<reference path="../../../headers/common.d.ts" />

import angular from 'angular';
import coreModule from 'app/core/core_module';
import {saveAs} from 'file-saver';

import coreModule from 'app/core/core_module';
import {DashboardExporter} from './exporter';

export class DashExportCtrl {
Expand All @@ -22,9 +21,8 @@ export class DashExportCtrl {
}

save() {
var blob = new Blob([angular.toJson(this.dash, true)], { type: "application/json;charset=utf-8" });
var wnd: any = window;
wnd.saveAs(blob, this.dash.title + '-' + new Date().getTime() + '.json');
var blob = new Blob([angular.toJson(this.dash, true)], {type: 'application/json;charset=utf-8'});
saveAs(blob, this.dash.title + '-' + new Date().getTime() + '.json');
}

saveJson() {
Expand All @@ -44,7 +42,7 @@ export function dashExportDirective() {
controller: DashExportCtrl,
bindToController: true,
controllerAs: 'ctrl',
scope: {dismiss: "&"}
scope: {dismiss: '&'},
};
}

Expand Down

0 comments on commit 7fe1ac5

Please sign in to comment.