Use change event to be sure that file is loaded before the function
Click event can trigger the script before the user choose the file, so it will be loader on the next Open SVG click. Change event trigger the script after the user choose the file.master
parent
af52265e1f
commit
0bb9728067
|
@ -6193,7 +6193,7 @@ editor.init = function () {
|
|||
workarea[0].addEventListener('dragleave', onDragLeave);
|
||||
workarea[0].addEventListener('drop', importImage);
|
||||
|
||||
const open = $('<input type="file">').click(async function () {
|
||||
const open = $('<input type="file">').change(async function (e) {
|
||||
const ok = await editor.openPrep();
|
||||
if (!ok) { return; }
|
||||
svgCanvas.clear();
|
||||
|
|
|
@ -36368,7 +36368,7 @@
|
|||
workarea[0].addEventListener('dragover', onDragOver);
|
||||
workarea[0].addEventListener('dragleave', onDragLeave);
|
||||
workarea[0].addEventListener('drop', importImage);
|
||||
var open = $$b('<input type="file">').click(
|
||||
var open = $$b('<input type="file">').change(
|
||||
/*#__PURE__*/
|
||||
_asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
|
|
|
@ -36368,7 +36368,7 @@
|
|||
workarea[0].addEventListener('dragover', onDragOver);
|
||||
workarea[0].addEventListener('dragleave', onDragLeave);
|
||||
workarea[0].addEventListener('drop', importImage);
|
||||
var open = $$b('<input type="file">').click(
|
||||
var open = $$b('<input type="file">').change(
|
||||
/*#__PURE__*/
|
||||
_asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
|
|
Loading…
Reference in New Issue