From fccb2472853ee3d4543c1c1234b25011d089566b Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Thu, 12 Dec 2024 12:54:57 +0000 Subject: [PATCH] EditCheck: Only pause if check is not rejected The pause is to show the user the result of their action (sepcifically it was designed for AddReferenceEditCheck to let them see the reference in the page). If they reject, there is no need to pause. This applies to mulit-check too where it would cause a pause before moving on to the next check. Change-Id: I57f881b37051cc2e5ea6bda23fea66a2de2b342d --- editcheck/modules/EditCheckDialog.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/editcheck/modules/EditCheckDialog.js b/editcheck/modules/EditCheckDialog.js index 8097c5644c..dcd5cb2cd4 100644 --- a/editcheck/modules/EditCheckDialog.js +++ b/editcheck/modules/EditCheckDialog.js @@ -323,13 +323,17 @@ ve.ui.EditCheckDialog.prototype.onAct = function ( widget, choice, actionChosen, } if ( this.listener === 'onBeforeSave' ) { - // We must have been acting on the currentOffset + // If an action has been taken, we want to linger for a brief moment + // to show the result of the action before moving away + // TODO: This was written for AddReferenceEditCheck but should be + // more generic + const pause = data.action !== 'reject' ? 500 : 0; setTimeout( () => { - // We want to linger for a brief moment before moving away + // We must have been acting on the currentOffset this.currentChecks.splice( this.currentOffset, 1 ); this.currentOffset = Math.max( 0, this.currentOffset - 1 ); this.update(); - }, 500 ); + }, pause ); } } ); };