- Refactoring: Switch from $.param.querystring to URL

This commit is contained in:
Brett Zamir
2020-01-05 09:52:34 +08:00
parent 37424278d1
commit 56197a493c
3 changed files with 14 additions and 14 deletions

View File

@@ -28,8 +28,8 @@ export default {
svgEditor.setCustomHandlers({
async save (win, data) {
const svg = '<?xml version="1.0"?>\n' + data;
const qstr = $.param.querystring();
const [, name] = qstr.substr(9).split('/+get/');
const {pathname} = new URL(location);
const name = pathname.replace(/\/+get\//, '');
const svgData = encode64(svg);
if (!$('#export_canvas').length) {
$('<canvas>', {id: 'export_canvas'}).hide().appendTo('body');