Просмотр исходного кода

rename and mark functions as private

bergquist 7 лет назад
Родитель
Сommit
7bde98aff9
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      public/app/features/dashboard/export/export_modal.ts

+ 6 - 6
public/app/features/dashboard/export/export_modal.ts

@@ -21,11 +21,11 @@ export class DashExportCtrl {
     if (this.shareExternally) {
     if (this.shareExternally) {
       this.exporter.makeExportable(this.dash).then((dashboardJson: any) => {
       this.exporter.makeExportable(this.dash).then((dashboardJson: any) => {
         this.$scope.$apply(() => {
         this.$scope.$apply(() => {
-          this._saveFile(dashboardJson);
+          this.openSaveAsDialog(dashboardJson);
         });
         });
       });
       });
     } else {
     } else {
-      this._saveFile(this.dash.getSaveModelClone());
+      this.openSaveAsDialog(this.dash.getSaveModelClone());
     }
     }
   }
   }
 
 
@@ -33,22 +33,22 @@ export class DashExportCtrl {
     if (this.shareExternally) {
     if (this.shareExternally) {
       this.exporter.makeExportable(this.dash).then((dashboardJson: any) => {
       this.exporter.makeExportable(this.dash).then((dashboardJson: any) => {
         this.$scope.$apply(() => {
         this.$scope.$apply(() => {
-          this._viewJson(dashboardJson);
+          this.openJsonModal(dashboardJson);
         });
         });
       });
       });
     } else {
     } else {
-      this._viewJson(this.dash.getSaveModelClone());
+      this.openJsonModal(this.dash.getSaveModelClone());
     }
     }
   }
   }
 
 
-  _saveFile(dash: any) {
+  private openSaveAsDialog(dash: any) {
     const blob = new Blob([angular.toJson(dash, true)], {
     const blob = new Blob([angular.toJson(dash, true)], {
       type: 'application/json;charset=utf-8',
       type: 'application/json;charset=utf-8',
     });
     });
     saveAs(blob, dash.title + '-' + new Date().getTime() + '.json');
     saveAs(blob, dash.title + '-' + new Date().getTime() + '.json');
   }
   }
 
 
-  _viewJson(clone: any) {
+  private openJsonModal(clone: any) {
     const editScope = this.$rootScope.$new();
     const editScope = this.$rootScope.$new();
     editScope.object = clone;
     editScope.object = clone;
     editScope.enableCopy = true;
     editScope.enableCopy = true;