去除行效果了

This commit is contained in:
jljsj 2015-08-24 18:32:06 +08:00
parent c2be1cbf81
commit 6b66ad7dbf
2 changed files with 0 additions and 48 deletions

View File

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import Menu from 'rc-menu'; import Menu from 'rc-menu';
import velocity from 'velocity-animate'; import velocity from 'velocity-animate';
import EnterAnimation from 'enter-animation';
const animation = { const animation = {
enter(node, done) { enter(node, done) {
@ -59,40 +58,6 @@ const AntMenu = React.createClass({
prefixCls: 'ant-menu' prefixCls: 'ant-menu'
}; };
}, },
toggle(info) {
let dom = React.findDOMNode(info.item || info);
let ul = dom.getElementsByTagName('ul')[0];
function TweenAnimate(_dom) {
let num=Number((.12/_dom.children.length).toFixed(3));
if(info.open){
EnterAnimation.to(_dom,{duration:.15,data:'scale',interval:num});
}else{
EnterAnimation.to(_dom,{duration:.15,data:'scale',interval:num,direction:'leave',upend:true,ease:'cubic-bezier(0.6, 0.04, 0.98, 0.335)'});
}
}
if (this.props.mode && info.item && !ul) {
setTimeout(()=> {
ul = dom.getElementsByTagName('ul')[0];
TweenAnimate(ul);
}, 1);
} else {
if (!ul) {
ul = dom;
}
TweenAnimate(ul);
}
},
componentDidMount() {
this.componentDidUpdate(this.props);
},
componentDidUpdate(prevProps) {
//(dropdown)
if (!prevProps.mode) {
var height = React.findDOMNode(this).offsetHeight;
this.open = height ? true : false;//!this.open;
this.toggle(this);
}
},
render() { render() {
let openAnimation = ''; let openAnimation = '';
switch (this.props.mode) { switch (this.props.mode) {

View File

@ -203,12 +203,6 @@
height: 0; height: 0;
clear: both; clear: both;
} }
& .@{menu-prefix-cls}-vertical.@{menu-prefix-cls}-sub {
& > .@{menu-prefix-cls}-item, & > .@{menu-prefix-cls}-submenu {
transform-origin: 50% 0;
}
}
} }
&-vertical, &-inline { &-vertical, &-inline {
@ -241,7 +235,6 @@
&-vertical&-sub { &-vertical&-sub {
padding: 0; padding: 0;
transform-origin: 0 0; transform-origin: 0 0;
//animation-duration: 0.4s;
& > .@{menu-prefix-cls}-item, & > .@{menu-prefix-cls}-submenu { & > .@{menu-prefix-cls}-item, & > .@{menu-prefix-cls}-submenu {
transform-origin: 0 0; transform-origin: 0 0;
} }
@ -259,18 +252,12 @@
border-radius: 0; border-radius: 0;
box-shadow: none; box-shadow: none;
overflow: hidden; overflow: hidden;
& > .@{menu-prefix-cls}-item, & > .@{menu-prefix-cls}-submenu > .@{menu-prefix-cls}-submenu-title { & > .@{menu-prefix-cls}-item, & > .@{menu-prefix-cls}-submenu > .@{menu-prefix-cls}-submenu-title {
line-height: 34px; line-height: 34px;
height: 34px; height: 34px;
list-style-type: disc; list-style-type: disc;
list-style-position: inside; list-style-position: inside;
} }
& > .@{menu-prefix-cls}-item, & > .@{menu-prefix-cls}-submenu {
transform-origin: 50% -30px;
}
} }
} }