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

View File

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

View File

@ -54,7 +54,7 @@ export default {
},
async open () {
const ok = await this.openPrep();
if (!ok) { return; }
if (ok === 'Cancel') { return; }
this.svgCanvas.clear();
const input = document.createElement('input');
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
* and `false` after the user confirms.
*/
openPrep () {
async openPrep () {
$('#main_menu').hide();
if (this.svgCanvas.undoMgr.getUndoStackSize() === 0) {
return true;
}
return seConfirm(this.uiStrings.notification.QwantToOpen);
return await seConfirm(this.uiStrings.notification.QwantToOpen);
}
/**