Skip to content

Commit 81f727d

Browse files
committed
Add toolbar control to openChartifactViewer for showing source
1 parent 4fb794e commit 81f727d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/views/ChartifactDialog.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,17 @@ export const openChartifactViewer = async (chartifactMarkdown: string) => {
272272
};
273273

274274
chartifactWindow.postMessage(renderRequest, 'https://microsoft.github.io');
275+
276+
//Call here to show source
277+
const toolbarControl: {
278+
type: 'hostToolbarControl';
279+
showSource?: boolean;
280+
} = {
281+
type: 'hostToolbarControl',
282+
showSource: true
283+
};
284+
285+
chartifactWindow.postMessage(toolbarControl, 'https://microsoft.github.io');
275286

276287
// Remove the event listener after sending
277288
window.removeEventListener('message', handleMessage);

0 commit comments

Comments
 (0)