- Timestamp:
- 2021-11-30T14:06:55+13:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/ocr/src/components/EditPage.vue
r35751 r35762 2 2 <div class="edit-page-root"> 3 3 <div class="control-panel"> 4 <edit-action :description="translations.get('EditPage_Discard')" @action=" $emit('closeAndDiscard')" icon="cancel" />5 <edit-action :description="translations.get('EditPage_InvertColour')" @action="invert = !invert" icon="invert_colors" />4 <edit-action :description="translations.get('EditPage_Discard')" @action="closeAndDiscard" icon="cancel" /> 5 <edit-action :description="translations.get('EditPage_InvertColour')" @action="invertColours" icon="invert_colors" /> 6 6 <edit-action :description="translations.get('EditPage_Rotate')" v-model="rotateMode" icon="crop_rotate" toggleMode /> 7 7 <edit-action :description="translations.get('EditPage_Save')" @action="closeAndSave" icon="save" /> … … 165 165 import { mapState } from "vuex"; 166 166 import EditAction from "./EditAction.vue" 167 import { ModalController } from "./ModalDialog.vue" 167 168 168 169 export default { … … 181 182 rotation: 0, 182 183 rotateMode: false, 183 allowRotation: false 184 allowRotation: false, 185 edited: false 184 186 } 185 187 }, … … 205 207 }, 206 208 methods: { 209 closeAndDiscard(force) { 210 if (force || !this.edited) { 211 this.$emit("closeAndDiscard"); 212 return; 213 } 214 215 const that = this; 216 217 ModalController.open( 218 this.translations.get("DiscardEditsModal_Title"), 219 this.translations.get("DiscardEditsModal_Description"), 220 [ 221 this.translations.get("DiscardEditsModal_ButtonContinue"), 222 this.translations.get("DiscardEditsModal_ButtonCancel") 223 ], 224 async function(buttonName) { 225 if (buttonName === that.translations.get("DiscardEditsModal_ButtonContinue")) { 226 that.closeAndDiscard(true); 227 } 228 } 229 ); 230 }, 207 231 async closeAndSave() { 208 232 const Jimp = await import("jimp/es"); … … 225 249 226 250 this.$emit("closeAndSave", modifiedBuffer, Jimp.MIME_PNG); 251 }, 252 253 invertColours() { 254 this.invert = !this.invert; 255 this.edited = true; 227 256 }, 228 257 … … 263 292 this.rotation -= 360; 264 293 } 294 295 this.edited = true; 265 296 }, 266 297 onDocumentMouseUp() {
Note:
See TracChangeset
for help on using the changeset viewer.