1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 00:50:28 +00:00

Reordered helper functions

This commit is contained in:
Jeremy Ruston 2012-06-07 13:46:41 +01:00
parent adf83e71de
commit 2083b7959e

View File

@ -26,17 +26,6 @@ exports.startZoomer = function(x,y) {
$tw.utils.addClass(document.body,"in-zoomer");
};
exports.stopZoomer = function() {
var newScrollY = this.yFactor * (this.bodyHeight - this.windowHeight);
this.inZoomer = false;
window.scrollTo(0,newScrollY);
document.body.style[$tw.browser.transform] = "translateY(" + newScrollY * this.xFactor + "px) " +
"scale(" + this.scale + ") " +
"translateY(" + ((this.windowHeight / this.scale) - this.bodyHeight) * this.yFactor * this.xFactor + "px)";
$tw.utils.removeClass(document.body,"in-zoomer");
document.body.style[$tw.browser.transform] = "translateY(0) scale(1) translateY(0)";
};
/*
Zoom the body element given a touch/mouse position in screen coordinates
*/
@ -80,6 +69,17 @@ exports.hoverZoomer = function(x,y) {
document.body.style[$tw.browser.transform] = transform;
};
exports.stopZoomer = function() {
var newScrollY = this.yFactor * (this.bodyHeight - this.windowHeight);
this.inZoomer = false;
window.scrollTo(0,newScrollY);
document.body.style[$tw.browser.transform] = "translateY(" + newScrollY * this.xFactor + "px) " +
"scale(" + this.scale + ") " +
"translateY(" + ((this.windowHeight / this.scale) - this.bodyHeight) * this.yFactor * this.xFactor + "px)";
$tw.utils.removeClass(document.body,"in-zoomer");
document.body.style[$tw.browser.transform] = "translateY(0) scale(1) translateY(0)";
};
exports.handleEvent = function(event) {
switch(event.type) {
case "touchstart":