|
6 | 6 |
|
7 | 7 | function publishAllViews() { |
8 | 8 | numberOfPublishedImages = 0; |
9 | | - publishImages(structurizr.workspace.getViews().map(function(v) { return v.key; })); |
| 9 | + publishImages(structurizr.workspace.getViews()); |
10 | 10 | } |
11 | 11 |
|
12 | 12 | function publishViewsFinished() { |
|
15 | 15 |
|
16 | 16 | function publishImages(viewsToExport) { |
17 | 17 | if (viewsToExport && viewsToExport.length > 0) { |
18 | | - const viewToExport = viewsToExport[0]; |
| 18 | + const view = viewsToExport[0]; |
19 | 19 |
|
20 | | - structurizr.diagram.changeView(viewToExport, function () { |
| 20 | + changeView(view, function () { |
21 | 21 | structurizr.diagram.exportCurrentDiagramToPNG(true, false, function(diagramAsPNG) { |
22 | | - publishImage(viewToExport, viewToExport + '.png', diagramAsPNG, function() { |
| 22 | + publishImage(view.key, view.key + '.png', diagramAsPNG, function() { |
23 | 23 | numberOfPublishedImages++; |
24 | 24 |
|
25 | | - const view = structurizr.workspace.findViewByKey(viewToExport); |
26 | 25 | if (view.type !== structurizr.constants.IMAGE_VIEW_TYPE) { |
27 | 26 | structurizr.diagram.exportCurrentDiagramKeyToPNG(function (diagramKeyAsPNG) { |
28 | | - publishImage(viewToExport, viewToExport + '-key.png', diagramKeyAsPNG, function () { |
| 27 | + publishImage(view.key, view.key + '-key.png', diagramKeyAsPNG, function () { |
29 | 28 | viewsToExport.splice(0, 1); |
30 | 29 | publishImages(viewsToExport); |
31 | 30 | }) |
|
0 commit comments