jenkins-bot has submitted this change and it was merged. Change subject: Fix off-by-one error in TransclusionModel when moving items ......................................................................
Fix off-by-one error in TransclusionModel when moving items The error occurs when moving an item down (increasing index) which removes the item, adjusts the index and then inserts the item. The index shouldn't be adjusted when moving one down, however, because once removed everything shifts and the +1 index set initially to move it is still good. Change-Id: I44bd2b3eb4bbbef58a6ac181e75969ec7c2cab6f --- M modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js b/modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js index f8f17ce..3095d11 100644 --- a/modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js +++ b/modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js @@ -117,7 +117,7 @@ existing = ve.indexOf( item.add, this.parts ); if ( existing !== -1 ) { this.removePart( item.add ); - if ( index && index > existing ) { + if ( index && existing + 1 < index ) { index--; } } -- To view, visit https://gerrit.wikimedia.org/r/116011 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I44bd2b3eb4bbbef58a6ac181e75969ec7c2cab6f Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Trevor Parscal <tpars...@wikimedia.org> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits