animate.formLine¶
webix.animate.
formLine
(next, current, animation)¶webix.animate.formLine helper.
Please look into the linked official documentation.
Referenced by¶
- helpers
animate()
,animateView()
.- mixins
Scrollable()
.- views
grouplist()
,multiview()
.
External references¶
Code¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | webix.animate.formLine=function(next, current, animation){
var direction = animation.direction;
current.parentNode.style.position = "relative";
current.style.position = "absolute";
next.style.position = "absolute";
//this is initial shift of second view in animation
//normally we need to have this value as 0
//but FF has bug with animation initially invisible elements
//so we are adjusting this value, to make 1px of second view visible
var defAniPos = webix.env.isFF ? ( direction == "top" || direction == "left" ? -1 : 1) : 0;
if(direction=="top"||direction=="bottom"){
next.style.left="0px";
next.style.top = (animation.top || defAniPos) + (direction=="top"?1:-1)*current.offsetHeight+"px";
}
else{
next.style.top = (animation.top || 0) + "px";
next.style.left = defAniPos + (direction=="left"?1:-1)*current.offsetWidth+"px";
}
// apply 'keepViews' mode, iframe solution
//( keepViews won't work in case of "in" and "out" subtypes )
if(current.parentNode == next.parentNode && animation.keepViews)
next.style.display = "";
else
webix.html.insertBefore(next, current.nextSibling, current.parentNode);
if(animation.type == 'slide' && animation.subtype == 'out') {
next.style.left = "0px";
next.style.top = (animation.top || 0)+"px";
current.parentNode.removeChild(current);
webix.html.insertBefore(current, next.nextSibling, next.parentNode);
}
return [next, current];
};
|