fix initial content load
This commit is contained in:
@@ -56,7 +56,7 @@ template.innerHTML = `
|
|||||||
By default and where supported, SVG-Edit can store your editor preferences and SVG content locally on your machine so you do not need to add these back each time you load SVG-Edit. If, for privacy reasons, you do not wish to store this information on your machine, you can change away from the default option below.
|
By default and where supported, SVG-Edit can store your editor preferences and SVG content locally on your machine so you do not need to add these back each time you load SVG-Edit. If, for privacy reasons, you do not wish to store this information on your machine, you can change away from the default option below.
|
||||||
</p>
|
</p>
|
||||||
<select id="se-storage-pref">
|
<select id="se-storage-pref">
|
||||||
<option value="prefsAndContent" id="js-storage" disabled>Store preferences and SVG content locally</option>
|
<option value="prefsAndContent">Store preferences and SVG content locally</option>
|
||||||
<option value="prefsOnly">Only store preferences locally</option>
|
<option value="prefsOnly">Only store preferences locally</option>
|
||||||
<option value="noPrefsOrContent">Do not store my preferences or SVG content locally</option>
|
<option value="noPrefsOrContent">Do not store my preferences or SVG content locally</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -181,9 +181,3 @@ export class SeStorageDialog extends HTMLElement {
|
|||||||
|
|
||||||
// Register
|
// Register
|
||||||
customElements.define('se-storage-dialog', SeStorageDialog);
|
customElements.define('se-storage-dialog', SeStorageDialog);
|
||||||
|
|
||||||
/*
|
|
||||||
if ('localStorage' in window) { // && onWeb removed so Webkit works locally
|
|
||||||
this.storage = this.localStorage;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|||||||
@@ -478,7 +478,7 @@ class Editor {
|
|||||||
* @function module:SVGthis.init
|
* @function module:SVGthis.init
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
init () {
|
async init () {
|
||||||
try {
|
try {
|
||||||
// Image props dialog added to DOM
|
// Image props dialog added to DOM
|
||||||
const newSeImgPropDialog = document.createElement('se-img-prop-dialog');
|
const newSeImgPropDialog = document.createElement('se-img-prop-dialog');
|
||||||
@@ -505,6 +505,10 @@ class Editor {
|
|||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('localStorage' in window) { // && onWeb removed so Webkit works locally
|
||||||
|
this.storage = window.localStorage;
|
||||||
|
}
|
||||||
|
|
||||||
this.configObj.load();
|
this.configObj.load();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1147,6 +1151,8 @@ class Editor {
|
|||||||
this.ready(() => {
|
this.ready(() => {
|
||||||
injectExtendedContextMenuItemsIntoDom();
|
injectExtendedContextMenuItemsIntoDom();
|
||||||
});
|
});
|
||||||
|
// run callbacks stored by this.ready
|
||||||
|
await this.runCallbacks();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user