|
29 | 29 | :clipped-right="$isRTL" |
30 | 30 | app |
31 | 31 | > |
32 | | - <VBtn data-test="close" icon dark @click="handleClose"> |
| 32 | + <VBtn data-test="close" icon dark @click="handleClose()"> |
33 | 33 | <Icon>clear</Icon> |
34 | 34 | </VBtn> |
35 | 35 | <VToolbarTitle>{{ modalTitle }}</VToolbarTitle> |
|
116 | 116 | </div> |
117 | 117 | </VFlex> |
118 | 118 | <VFlex shrink> |
119 | | - <VBtn color="primary" @click="handleClose"> |
| 119 | + <VBtn color="primary" @click="handleClose()"> |
120 | 120 | {{ $tr('finishButton') }} |
121 | 121 | </VBtn> |
122 | 122 | </VFlex> |
|
421 | 421 | /* Button actions */ |
422 | 422 | handleClose() { |
423 | 423 | // X button action |
424 | | - this.enableValidation(this.nodeIds); |
425 | | - let assessmentItems = this.getAssessmentItems(this.nodeIds); |
426 | | - assessmentItems.forEach(item => (item.question ? (item[DELAYED_VALIDATION] = false) : '')); |
427 | | - this.updateAssessmentItems(assessmentItems); |
428 | | - // reaches into Details Tab to run save of diffTracker |
429 | | - // before the validation pop up is executed |
430 | | - if (this.$refs.editView) { |
431 | | - this.$refs.editView.immediateSaveAll().then(() => { |
432 | | - // Catch uploads in progress and invalid nodes |
433 | | - if (this.invalidNodes.length) { |
434 | | - this.selected = [this.invalidNodes[0]]; |
435 | | - this.promptInvalid = true; |
436 | | - } else if (this.contentNodesAreUploading(this.nodeIds)) { |
437 | | - this.promptUploading = true; |
438 | | - } else { |
439 | | - this.closeModal(); |
440 | | - } |
441 | | - }); |
442 | | - } else { |
443 | | - this.closeModal(); |
444 | | - } |
| 424 | + this.selected = this.nodeIds; |
| 425 | + this.$nextTick(() => { |
| 426 | + this.enableValidation(this.nodeIds); |
| 427 | + let assessmentItems = this.getAssessmentItems(this.nodeIds); |
| 428 | + assessmentItems.forEach(item => |
| 429 | + item.question ? (item[DELAYED_VALIDATION] = false) : '' |
| 430 | + ); |
| 431 | + this.updateAssessmentItems(assessmentItems); |
| 432 | +
|
| 433 | + // reaches into Details Tab to run save of diffTracker |
| 434 | + // before the validation pop up is executed |
| 435 | + if (this.$refs.editView) { |
| 436 | + this.$nextTick(() => { |
| 437 | + this.$refs.editView.immediateSaveAll().then(() => { |
| 438 | + // Catch uploads in progress and invalid nodes |
| 439 | + if (this.invalidNodes.length) { |
| 440 | + this.selected = [this.invalidNodes[0]]; |
| 441 | + this.promptInvalid = true; |
| 442 | + } else if (this.contentNodesAreUploading(this.nodeIds)) { |
| 443 | + this.promptUploading = true; |
| 444 | + } else { |
| 445 | + this.closeModal(); |
| 446 | + } |
| 447 | + }); |
| 448 | + }); |
| 449 | + } else { |
| 450 | + this.closeModal(); |
| 451 | + } |
| 452 | + }); |
445 | 453 | }, |
446 | 454 |
|
447 | 455 | /* Creation actions */ |
|
0 commit comments