Skip to content

Commit

Permalink
Code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroDinis committed Dec 10, 2023
1 parent 09bfae0 commit 00fb9ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/components/DocumentAnnotations/AnnotationRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@
:save-btn="showSaveButton()"
:restore-btn="showRestoreButton()"
:is-loading="isLoading"
@mark-as-missing="handleMissingAnnotation()"
@save="handleSaveChanges()"
@accept="handleSaveChanges()"
@mark-as-missing="handleMissingAnnotation"
@save="handleSaveChanges"
@accept="handleSaveChanges"
@decline="handleSaveChanges(true)"
@cancel="handleCancelButton()"
@restore="handleRestore()"
@cancel="handleCancelButton"
@restore="handleRestore"
@search-label-in-document="searchLabelInDocument"
/>
</div>
Expand Down Expand Up @@ -512,7 +512,7 @@ export default {
false
);
},
handleSaveChanges(decline) {
handleSaveChanges(decline = false) {
if (this.publicView || this.isDocumentReviewed) return;
// Verify if we are editing a filled or empty annotation
Expand Down
6 changes: 3 additions & 3 deletions src/components/DocumentAnnotations/DocumentAnnotations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,6 @@ export default {
// Not allow starting edit mode with ArrowUp key
if (event.key === "ArrowUp" && !this.isAnnotationBeingEdited) return;
// open accordions
this.openAllAccordions();
// Get all the annotation elements
let annotations = this.createArray("keyboard-nav");
Expand All @@ -403,6 +400,9 @@ export default {
// navigate with the arrow up or down keys
if (event.key === "ArrowDown") {
// open accordions
this.openAllAccordions();
// Check if we are focusing on the Finish Review button
if (this.count >= annotations.length) {
const finishBtn = this.createArray("finish-review-btn");
Expand Down

0 comments on commit 00fb9ca

Please sign in to comment.