fix so that mouse is always on the handle

v1.18.x
psychobunny 10 years ago
parent 5b56157403
commit bc9d7f2922

@ -59,9 +59,9 @@ define('composer/resize', function() {
resize.handleResize = function(postContainer) { resize.handleResize = function(postContainer) {
function resizeStart(e) { function resizeStart(e) {
var resizeRect = resizeEl[0].getBoundingClientRect(), var resizeRect = resizeEl[0].getBoundingClientRect(),
resizeCenterY = resizeRect.top + (resizeRect.height/2); resizeCenterY = resizeRect.top + resizeRect.height;
resizeOffset = resizeCenterY - e.clientY; resizeOffset = (resizeCenterY - e.clientY) / 2;
resizeActive = true; resizeActive = true;
resizeDown = e.clientY; resizeDown = e.clientY;
@ -78,7 +78,7 @@ define('composer/resize', function() {
$(window).off('mouseup', resizeStop); $(window).off('mouseup', resizeStop);
$('body').off('touchmove', resizeTouchAction); $('body').off('touchmove', resizeTouchAction);
var position = (e.clientY + resizeOffset), var position = (e.clientY - resizeOffset),
newHeight = $(window).height() - position, newHeight = $(window).height() - position,
windowHeight = $(window).height(); windowHeight = $(window).height();
@ -113,7 +113,7 @@ define('composer/resize', function() {
function resizeAction(e) { function resizeAction(e) {
if (resizeActive) { if (resizeActive) {
var position = (e.clientY + resizeOffset), var position = (e.clientY - resizeOffset),
newHeight = $(window).height() - position; newHeight = $(window).height() - position;
doResize(postContainer, newHeight / $(window).height()); doResize(postContainer, newHeight / $(window).height());

Loading…
Cancel
Save