mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-11 01:43:23 +01:00
Add download on editor
This commit is contained in:
parent
f8b424e823
commit
03d4e22442
@ -212,12 +212,15 @@ class Menu extends IMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._addButton('export', false, false, () => {
|
this._addButton('export', false, false, () => {
|
||||||
// BootstrapDialogRequest.active = new BootstrapDialogRequest(`c/maps/${mapId}/exportf`, $msg('EXPORT'), {
|
|
||||||
// cancelButton: true,
|
|
||||||
// closeButton: true,
|
|
||||||
// });
|
|
||||||
const svgContent = designer.export('svg');
|
const svgContent = designer.export('svg');
|
||||||
console.log(svgContent);
|
console.log(svgContent);
|
||||||
|
|
||||||
|
const anchor = $('#export_anchor');
|
||||||
|
anchor.attr('download', `${mapId}.svg`);
|
||||||
|
// anchor.attr('href', `data:image/svg+xml;base64,${btoa(svgContent)}`);
|
||||||
|
anchor.attr('href', 'https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/svg.svg');
|
||||||
|
|
||||||
|
anchor.click();
|
||||||
});
|
});
|
||||||
Menu._registerTooltip('export', $msg('EXPORT'));
|
Menu._registerTooltip('export', $msg('EXPORT'));
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
<div id="export" class="buttonOn">
|
<div id="export" class="buttonOn">
|
||||||
<img src="images/export.svg" />
|
<img src="images/export.svg" />
|
||||||
</div>
|
</div>
|
||||||
|
<a id="export_anchor" href="" download=""></a>
|
||||||
</div>
|
</div>
|
||||||
<div id="edit" class="buttonContainer">
|
<div id="edit" class="buttonContainer">
|
||||||
<div id="undoEdition" class="buttonOn">
|
<div id="undoEdition" class="buttonOn">
|
||||||
|
Loading…
Reference in New Issue
Block a user