Remove weird animations from backlog
Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
parent
77e3ce05aa
commit
5d69e9cef5
File diff suppressed because one or more lines are too long
@ -10,12 +10,18 @@ import { v4 as uuidv4 } from 'uuid';
|
|||||||
|
|
||||||
const data = window.shop_data;
|
const data = window.shop_data;
|
||||||
|
|
||||||
const productStyle = (style, snapshot, removeAnim, hovered, selected) => {
|
const productStyle = (style, snapshot, removeAnim, hovered, selected, cart=false) => {
|
||||||
const custom = {
|
const custom = {
|
||||||
opacity: snapshot.isDragging ? .7 : 1,
|
opacity: snapshot.isDragging ? .7 : 1,
|
||||||
backgroundColor: (hovered || selected) ? '#eae7f7' : 'initial',
|
backgroundColor: (hovered || selected) ? '#eae7f7' : 'initial',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!cart && snapshot.draggingOver == null && // hack for backlog
|
||||||
|
((!snapshot.isDragging) // prevent next elements from animation
|
||||||
|
|| (snapshot.isDragging && snapshot.isDropAnimating))) { // prevent dragged element from weird animation
|
||||||
|
style.transform = "none";
|
||||||
|
}
|
||||||
|
|
||||||
if (!snapshot.isDropAnimating) {
|
if (!snapshot.isDropAnimating) {
|
||||||
return { ...style, ...custom};
|
return { ...style, ...custom};
|
||||||
}
|
}
|
||||||
@ -680,6 +686,7 @@ class ProductCartItem extends React.PureComponent {
|
|||||||
true,
|
true,
|
||||||
hovered ? true : false,
|
hovered ? true : false,
|
||||||
model.selected ? true : false,
|
model.selected ? true : false,
|
||||||
|
true
|
||||||
)}}
|
)}}
|
||||||
onMouseEnter={this.handleOnMouseEnterRemoveItem.bind(this, index)}
|
onMouseEnter={this.handleOnMouseEnterRemoveItem.bind(this, index)}
|
||||||
onMouseLeave={this.handleOnMouseLeaveRemoveItem.bind(this, index)}
|
onMouseLeave={this.handleOnMouseLeaveRemoveItem.bind(this, index)}
|
||||||
@ -1965,23 +1972,25 @@ class Shop extends React.PureComponent {
|
|||||||
switch(source.droppableId) {
|
switch(source.droppableId) {
|
||||||
|
|
||||||
case 'backlog':
|
case 'backlog':
|
||||||
this.setState({
|
if (source.droppableId !== destination.droppableId) {
|
||||||
...this.state,
|
this.setState({
|
||||||
newCardJustAdded: newAdded ? true : false,
|
...this.state,
|
||||||
columns: {
|
newCardJustAdded: newAdded ? true : false,
|
||||||
...this.state.columns,
|
columns: {
|
||||||
[destination.droppableId]: {
|
...this.state.columns,
|
||||||
...this.state.columns[destination.droppableId],
|
[destination.droppableId]: {
|
||||||
items: copy(
|
...this.state.columns[destination.droppableId],
|
||||||
this.state.items,
|
items: copy(
|
||||||
this.state.columns[source.droppableId],
|
this.state.items,
|
||||||
this.state.columns[destination.droppableId],
|
this.state.columns[source.droppableId],
|
||||||
draggableId,
|
this.state.columns[destination.droppableId],
|
||||||
destination,
|
draggableId,
|
||||||
),
|
destination,
|
||||||
|
),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
});
|
||||||
});
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case destination.droppableId:
|
case destination.droppableId:
|
||||||
|
@ -17,6 +17,8 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
//devtool: "inline-source-map",
|
||||||
|
//mode: "development"
|
||||||
devtool: false,
|
devtool: false,
|
||||||
mode: "production"
|
mode: "production"
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user