Fix: use messageBox
This commit is contained in:
parent
ae50cbe12a
commit
4d8268bb27
21
edit/edit.js
21
edit/edit.js
|
@ -1900,10 +1900,23 @@ function replaceStyle(request) {
|
||||||
}
|
}
|
||||||
if (!codeIsUpdated) {
|
if (!codeIsUpdated) {
|
||||||
editor.replaceMeta(request.style);
|
editor.replaceMeta(request.style);
|
||||||
} else if (editor.isTouched() && !confirm(t('styleUpdateDiscardChanges'))) {
|
return;
|
||||||
editor.setStyleDirty(request.style);
|
}
|
||||||
} else {
|
|
||||||
editor.replaceStyle(request.style);
|
askDiscardChanges()
|
||||||
|
.then(result => {
|
||||||
|
if (result) {
|
||||||
|
editor.replaceStyle(request.style);
|
||||||
|
} else {
|
||||||
|
editor.setStyleDirty(request.style);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function askDiscardChanges() {
|
||||||
|
if (!editor.isTouched()) {
|
||||||
|
return Promise.resolve(true);
|
||||||
|
}
|
||||||
|
return messageBox.confirm(t('styleUpdateDiscardChanges'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user