You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
941 B
39 lines
941 B
// ================== Collapse Motion ==================
|
|
var getCollapsedHeight = function getCollapsedHeight() {
|
|
return {
|
|
height: 0,
|
|
opacity: 0
|
|
};
|
|
};
|
|
|
|
var getRealHeight = function getRealHeight(node) {
|
|
return {
|
|
height: node.scrollHeight,
|
|
opacity: 1
|
|
};
|
|
};
|
|
|
|
var getCurrentHeight = function getCurrentHeight(node) {
|
|
return {
|
|
height: node.offsetHeight
|
|
};
|
|
};
|
|
|
|
var skipOpacityTransition = function skipOpacityTransition(_, event) {
|
|
return event.propertyName === 'height';
|
|
};
|
|
|
|
var collapseMotion = {
|
|
motionName: 'ant-motion-collapse',
|
|
onAppearStart: getCollapsedHeight,
|
|
onEnterStart: getCollapsedHeight,
|
|
onAppearActive: getRealHeight,
|
|
onEnterActive: getRealHeight,
|
|
onLeaveStart: getCurrentHeight,
|
|
onLeaveActive: getCollapsedHeight,
|
|
onAppearEnd: skipOpacityTransition,
|
|
onEnterEnd: skipOpacityTransition,
|
|
onLeaveEnd: skipOpacityTransition,
|
|
motionDeadline: 500
|
|
};
|
|
export default collapseMotion; |