Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
1fa9e7420f
1 changed files with 8 additions and 5 deletions
|
@ -314,7 +314,7 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
// Is the tag ordered manually?
|
// Is the tag ordered manually?
|
||||||
if (newTag && !newTag.match(/^(m\.lowpriority|im\.vector\.fake\.(invite|recent|direct|archived))$/)) {
|
if (newTag && !newTag.match(/^(m\.lowpriority|im\.vector\.fake\.(invite|recent|direct|archived))$/)) {
|
||||||
const newList = Object.assign({}, this.state.lists[newTag]);
|
const newList = this.state.lists[newTag];
|
||||||
|
|
||||||
// If the room was moved "down" (increasing index) in the same list we
|
// If the room was moved "down" (increasing index) in the same list we
|
||||||
// need to use the orders of the tiles with indices shifted by +1
|
// need to use the orders of the tiles with indices shifted by +1
|
||||||
|
@ -322,10 +322,13 @@ module.exports = React.createClass({
|
||||||
newTag === prevTag && result.source.index < result.destination.index
|
newTag === prevTag && result.source.index < result.destination.index
|
||||||
) ? 1 : 0;
|
) ? 1 : 0;
|
||||||
|
|
||||||
const prevOrder = newIndex === 0 ?
|
const indexBefore = offset + newIndex - 1;
|
||||||
0 : newList[offset + newIndex - 1].tags[newTag].order;
|
const indexAfter = offset + newIndex;
|
||||||
const nextOrder = newIndex === newList.length ?
|
|
||||||
1 : newList[offset + newIndex].tags[newTag].order;
|
const prevOrder = indexBefore < 0 ?
|
||||||
|
0 : newList[indexBefore].tags[newTag].order;
|
||||||
|
const nextOrder = indexAfter >= newList.length ?
|
||||||
|
1 : newList[indexAfter].tags[newTag].order;
|
||||||
|
|
||||||
newOrder = {
|
newOrder = {
|
||||||
order: (prevOrder + nextOrder) / 2.0,
|
order: (prevOrder + nextOrder) / 2.0,
|
||||||
|
|
Loading…
Reference in a new issue