- Breaking change: Remove storagePromptClosed state boolean in favor of

`storagePromptState`; used by `ext-storage.js`
- Fix (regression): Ensure storage dialog will not be blocked because of
    canvas updating done for sake of centering background
- Fix (extensions): Ensure `langReady` changes are available by time prefs
  dialog is closed and that its changes have occurred by time extensions
  have first loaded (`setLang` now returns a Promise rather than `undefined`
  as it waits for extension's `langReady` to resolve); this is also useful
  with `ext-storage.js` so we know that `extensions_loaded` (which
  conditionally updates the canvas based on `storagePromptState`) has seen
  `langReady` and the storage extension hasn't set a `storagePromptState`
  of "waiting"
This commit is contained in:
Brett Zamir
2018-10-21 18:33:23 +08:00
parent c37e60fd87
commit d13f99bb5e
12 changed files with 2580 additions and 2171 deletions

View File

@@ -76,7 +76,8 @@ var svgEditorExtension_storage = (function () {
emptyStorageOnDecline = _svgEditor$curConfig.emptyStorageOnDecline,
noStorageOnLoad = _svgEditor$curConfig.noStorageOnLoad,
forceStorage = _svgEditor$curConfig.forceStorage;
var storage = svgEditor.storage;
var storage = svgEditor.storage,
updateCanvas = svgEditor.updateCanvas;
function replaceStoragePrompt(val) {
val = val ? 'storagePrompt=' + val : '';
@@ -304,12 +305,14 @@ var svgEditorExtension_storage = (function () {
// the prompt gives the user the option to store data
setupBeforeUnloadListener();
svgEditor.storagePromptClosed = true;
svgEditor.storagePromptState = 'closed';
updateCanvas(true);
}, null, null, {
label: rememberLabel,
checked: true,
tooltip: rememberTooltip
});
svgEditor.storagePromptState = 'waiting';
} else if (!noStorageOnLoad || forceStorage) {
setupBeforeUnloadListener();
}