Further refinements to the list mechanism

Much better navigation animation for classic view
This commit is contained in:
Jeremy Ruston
2012-10-26 22:12:40 +01:00
parent 865e26bbce
commit 324a87a8a2
6 changed files with 67 additions and 21 deletions
+4 -4
View File
@@ -92,20 +92,20 @@ var eventNameMappings = {
"transitionEnd": {
correspondingCssProperty: "transition",
mappings: {
transition: "transitionEnd",
transition: "transitionend",
OTransition: "oTransitionEnd",
MSTransition: "msTransitionEnd",
MozTransition: "transitionEnd",
MozTransition: "transitionend",
webkitTransition: "webkitTransitionEnd"
}
},
"animationEnd": {
correspondingCssProperty: "animation",
mappings: {
animation: "animationEnd",
animation: "animationend",
OAnimation: "oAnimationEnd",
MSAnimation: "msAnimationEnd",
MozAnimation: "animationEnd",
MozAnimation: "animationend",
webkitAnimation: "webkitAnimationEnd"
}
}
+16
View File
@@ -91,6 +91,22 @@ exports.getScrollPosition = function() {
}
};
/*
Gets the bounding rectangle of an element in absolute page coordinates
*/
exports.getBoundingPageRect = function(element) {
var scrollPos = $tw.utils.getScrollPosition(),
clientRect = element.getBoundingClientRect();
return {
left: clientRect.left + scrollPos.x,
width: clientRect.width,
right: clientRect.right + scrollPos.x,
top: clientRect.top + scrollPos.y,
height: clientRect.height,
bottom: clientRect.bottom + scrollPos.y
};
};
/*
Saves a named password in the browser
*/