#issue_fix double click and opensvg issue fixed

master
Agriya Dev5 2021-01-04 19:56:12 +05:30
parent 62d63b3efd
commit b173b6c2f7
4 changed files with 6 additions and 6 deletions

View File

@ -111,7 +111,7 @@ export class SeMenu extends HTMLElement {
* @function connectedCallback * @function connectedCallback
* @returns {void} * @returns {void}
*/ */
connectedCallback () { /* connectedCallback () {
this.$menu.addEventListener('openedchange', (e) => { this.$menu.addEventListener('openedchange', (e) => {
e.preventDefault(); e.preventDefault();
const selectedItem = e?.detail?.closeResult; const selectedItem = e?.detail?.closeResult;
@ -119,7 +119,7 @@ export class SeMenu extends HTMLElement {
document.getElementById(selectedItem.id).click(); document.getElementById(selectedItem.id).click();
} }
}); });
} } */
} }
// Register // Register

View File

@ -1,8 +1,8 @@
// eslint-disable-next-line node/no-unpublished-import // eslint-disable-next-line node/no-unpublished-import
import AlertDialog from 'elix/define/AlertDialog.js'; import AlertDialog from 'elix/define/AlertDialog.js';
const dialog = new AlertDialog();
const seConfirm = async (text, choices) => { const seConfirm = async (text, choices) => {
const dialog = new AlertDialog();
dialog.textContent = text; dialog.textContent = text;
dialog.choices = (choices === undefined) ? ['Ok', 'Cancel'] : choices; dialog.choices = (choices === undefined) ? ['Ok', 'Cancel'] : choices;
dialog.open(); dialog.open();

View File

@ -54,7 +54,7 @@ export default {
}, },
async open () { async open () {
const ok = await this.openPrep(); const ok = await this.openPrep();
if (!ok) { return; } if (ok === 'Cancel') { return; }
this.svgCanvas.clear(); this.svgCanvas.clear();
const input = document.createElement('input'); const input = document.createElement('input');
input.type = 'file'; input.type = 'file';

View File

@ -1398,12 +1398,12 @@ class Editor extends EditorStartup {
* @returns {boolean|Promise<boolean>} Resolves to boolean indicating `true` if there were no changes * @returns {boolean|Promise<boolean>} Resolves to boolean indicating `true` if there were no changes
* and `false` after the user confirms. * and `false` after the user confirms.
*/ */
openPrep () { async openPrep () {
$('#main_menu').hide(); $('#main_menu').hide();
if (this.svgCanvas.undoMgr.getUndoStackSize() === 0) { if (this.svgCanvas.undoMgr.getUndoStackSize() === 0) {
return true; return true;
} }
return seConfirm(this.uiStrings.notification.QwantToOpen); return await seConfirm(this.uiStrings.notification.QwantToOpen);
} }
/** /**