1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-07 09:18:06 +00:00

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

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
*/