- Timestamp:
- 2021-11-25T14:58:41+13:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/ocr/src/components/MainPage.vue
r35748 r35751 1 1 <template> 2 2 <div class="main-page-root"> 3 <modal-dialog v-if="modal.show" :title="modal.title" :description="modal.description" :buttons="modal.buttons" @close="onModalClose" /> 3 4 <edit-page v-if="showEditor" class="image-editor" :src="imageUrl" :imageBuffer="imageBuffer" 4 5 @closeAndDiscard="onEditorCloseRequested" @closeAndSave="onEditorSave" /> … … 23 24 </button> 24 25 25 <button class="btn-primary" @click="reset " :disabled="ocrInProgress">26 <button class="btn-primary" @click="reset(false)" :disabled="ocrInProgress"> 26 27 <span class="material-icons">restart_alt</span> 27 28 <span>{{ translations.get("MainPage_NewImage") }}</span> … … 144 145 import { mapState } from "vuex"; 145 146 import EditPage from "./EditPage.vue"; 147 import ModalDialog from "./ModalDialog.vue" 146 148 import OcrService, { OcrOptions } from "../js/OcrService" 147 149 import { log } from "../js/Util"; … … 152 154 name: "MainPage", 153 155 components: { 154 EditPage 156 EditPage, 157 ModalDialog 155 158 }, 156 159 data() { … … 162 165 ocrInProgress: false, 163 166 ocrResult: null, 164 showEditor: false 167 showEditor: false, 168 modal: { 169 show: false, 170 title: "", 171 description: "", 172 buttons: [] 173 } 165 174 } 166 175 }, … … 242 251 }, 243 252 244 reset() { 253 reset(hard) { 254 if (!hard) { 255 // TODO: Translate 256 this.modal.title = this.translations.get("NewImageModal_Title"); 257 this.modal.description = this.translations.get("NewImageModal_Description"); 258 this.modal.buttons = [ 259 this.translations.get("NewImageModal_ButtonContinue"), 260 this.translations.get("NewImageModal_ButtonCancel") 261 ] 262 this.modal.resetConfirmation = true; 263 this.modal.show = true; 264 265 return; 266 } 267 245 268 URL.revokeObjectURL(this.imageUrl); 246 269 this.imageUrl = null; … … 249 272 this.showEditor = false; 250 273 this.$refs.fileInput.value = ""; 274 }, 275 276 onModalClose(button) { 277 this.modal.show = false; 278 279 if (this.modal.resetConfirmation) { 280 if (button === "Continue") { 281 this.reset(true); 282 } 283 284 this.modal.resetConfirmation = false; 285 } 251 286 } 252 287 }
Note:
See TracChangeset
for help on using the changeset viewer.