Monotone-Parent: 73b3e5e425401db9c7ad2fc28660a6447ad0c4a5

Monotone-Revision: 56874b8e1d2260289bbdde17c8dbc01a15f354e7

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-09-17T21:39:36
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2008-09-17 21:39:36 +00:00
parent 032a99adf2
commit cf911feea7
5 changed files with 12 additions and 3 deletions

View File

@ -4,6 +4,7 @@ var SOGoDragHandlesInterface = {
leftMargin: 180,
topMargin: 120,
dhType: null,
dhLimit: null,
origX: -1,
origLeft: -1,
origRight: -1,
@ -23,12 +24,16 @@ var SOGoDragHandlesInterface = {
this.observe("mousedown", this.startHandleDraggingBound, false);
},
_determineType: function () {
if (this.leftBlock && this.rightBlock)
if (this.leftBlock && this.rightBlock) {
this.dhType = 'horizontal';
else if (this.upperBlock && this.lowerBlock)
this.dhLimit = window.width() - 10;
}
else if (this.upperBlock && this.lowerBlock) {
this.dhType = 'vertical';
this.dhLimit = window.height() - 10;
}
},
startHandleDragging: function (event) {
startHandleDragging: function (event) { log("startHandleDragging");
if (!this.dhType)
this._determineType();
var targ = getTarget(event);
@ -103,6 +108,8 @@ var SOGoDragHandlesInterface = {
var width = this.offsetWidth;
if (hX < this.leftMargin)
hX = this.leftMargin + Math.floor(width / 2);
else if (hX > this.dhLimit)
log ("limit");
var newLeft = Math.floor(hX - (width / 2));
this.setStyle({ left: newLeft + 'px' });
} else if (this.dhType == 'vertical') {
@ -110,6 +117,8 @@ var SOGoDragHandlesInterface = {
var hY = Event.pointerY(event);
if (hY < this.topMargin)
hY = this.topMargin + Math.floor(height / 2);
else if (hY > this.dhLimit)
log ("limit");
var newTop = Math.floor(hY - (height / 2)) - delta;
this.setStyle({ top: newTop + 'px' });
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB