mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
fix: Fix downloading screenshots on the playground. (#6025)
* fix: Fix downloading screenshots on the playground. * fix: Resolve lint warning about unused variable.
This commit is contained in:
@@ -121,7 +121,7 @@ function configureContextMenu(menuOptions, e) {
|
||||
text: 'Download Screenshot',
|
||||
enabled: workspace.getTopBlocks().length,
|
||||
callback: function() {
|
||||
Blockly.downloadScreenshot(workspace);
|
||||
downloadScreenshot(workspace);
|
||||
}
|
||||
};
|
||||
menuOptions.push(screenshotOption);
|
||||
|
||||
@@ -95,7 +95,7 @@ function workspaceToSvg_(workspace, callback, customCss) {
|
||||
* Download a screenshot of the blocks on a Blockly workspace.
|
||||
* @param {!Blockly.WorkspaceSvg} workspace The Blockly workspace.
|
||||
*/
|
||||
Blockly.downloadScreenshot = function(workspace) {
|
||||
function downloadScreenshot(workspace) {
|
||||
workspaceToSvg_(workspace, function(datauri) {
|
||||
const a = document.createElement('a');
|
||||
a.download = 'screenshot.png';
|
||||
|
||||
Reference in New Issue
Block a user