mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
39eea83698
Moving items around in the MetaList only works if all deletions are done before all insertions. This was almost but not completely true: when moving an existing item we would delete it and immediately re- insert it, meaning that if there were multiple items being moved there would be a removal after an insertion. Instead, let the insertion loop re-insert the moved items while making sure not to emit insert events for them. This is how I originally intended the code to be structured, but I thought that duplicating the insertion would be equivalent to protecting the emission of the insertion event. Clearly I was wrong. This fixes weird bugs where categories sometimes appeared twice in the category dialog depending on where the category was in the list and what the exact length of the list was (i.e., whether the binary search in the MetaList found the first or second item with identical offset and index). Change-Id: I4cd131052dda396add7a0e2dbe2383bb5c1b5721 |
||
---|---|---|
.. | ||
ce | ||
dm | ||
init | ||
test | ||
ui | ||
ve.BranchNode.js | ||
ve.debug.js | ||
ve.Document.js | ||
ve.EventSequencer.js | ||
ve.js | ||
ve.LeafNode.js | ||
ve.Node.js | ||
ve.Range.js | ||
ve.track.js |