mirror of
https://github.com/igorski/bitmappery.git
synced 2026-07-24 15:57:42 +02:00
Added confirmation window prior to document resize to indicate it is permanent
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
"en-US": {
|
||||
"resizeDocument": "Resize document",
|
||||
"maintainAspectRatio": "Maintain aspect ratio",
|
||||
"areYouSure": "Are you sure?",
|
||||
"resizeIsPermanent": "Resizing a document is permanent and cannot be undone.",
|
||||
"save": "Save",
|
||||
"cancel": "Cancel"
|
||||
}
|
||||
|
||||
@@ -116,21 +116,31 @@ export default {
|
||||
"closeModal",
|
||||
"setActiveDocumentSize",
|
||||
"resizeActiveDocumentContent",
|
||||
"openDialog",
|
||||
"resetHistory"
|
||||
]),
|
||||
lockSync() {
|
||||
async lockSync() {
|
||||
this.syncLock = true;
|
||||
this.$nextTick(() => {
|
||||
this.syncLock = false;
|
||||
});
|
||||
await this.$nextTick();
|
||||
this.syncLock = false;
|
||||
},
|
||||
async save() {
|
||||
const { width, height } = this.dimensions;
|
||||
const scaleX = width / this.activeDocument.width;
|
||||
const scaleY = height / this.activeDocument.height;
|
||||
save() {
|
||||
this.openDialog({
|
||||
type: "confirm",
|
||||
title: this.$t( "areYouSure" ),
|
||||
message: this.$t( "resizeIsPermanent" ),
|
||||
confirm: async () => {
|
||||
const { width, height } = this.dimensions;
|
||||
const scaleX = width / this.activeDocument.width;
|
||||
const scaleY = height / this.activeDocument.height;
|
||||
|
||||
await this.resizeActiveDocumentContent({ scaleX, scaleY });
|
||||
this.setActiveDocumentSize({ width: Math.round( width ), height: Math.round( height ) });
|
||||
this.closeModal();
|
||||
await this.resizeActiveDocumentContent({ scaleX, scaleY });
|
||||
this.setActiveDocumentSize({ width: Math.round( width ), height: Math.round( height ) });
|
||||
this.resetHistory();
|
||||
this.closeModal();
|
||||
},
|
||||
cancel: () => {},
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user