mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-06 08:55:08 +00:00
See ChangeLog.
Monotone-Parent: 83140ea045c02e9961515cc478033e97df559cfb Monotone-Revision: e4e20cbfe1ccdc91e3f5a7fe6041b89f791885c4 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-03-15T19:17:25
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2012-03-15 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/SOGoDragHandles.js (enableRightSafety):
|
||||
new method to display a "safety" block on top of the right block
|
||||
when dragging the handle. This fixes a problem when the right
|
||||
block contains an instance of CKEditor.
|
||||
|
||||
2012-03-14 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/MailerUI/UIxMailFolderActions.m (-deleteAction): we now
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
/*
|
||||
* Drag handle widget interface to be added to a DIV (the drag handle)
|
||||
*
|
||||
* Available events:
|
||||
* handle:resize -- fired once the value of the input has changed
|
||||
* handle:dragged --
|
||||
*
|
||||
*/
|
||||
var SOGoDragHandlesInterface = {
|
||||
leftMargin: 180,
|
||||
topMargin: 180,
|
||||
@@ -17,6 +25,7 @@ var SOGoDragHandlesInterface = {
|
||||
rightBlock: null,
|
||||
upperBlock: null,
|
||||
lowerBlock: null,
|
||||
rightSafetyBlock: null,
|
||||
startHandleDraggingBound: null,
|
||||
stopHandleDraggingBound: null,
|
||||
moveBound: null,
|
||||
@@ -25,6 +34,11 @@ var SOGoDragHandlesInterface = {
|
||||
this.startHandleDraggingBound = this.startHandleDragging.bindAsEventListener(this);
|
||||
this.observe("mousedown", this.startHandleDraggingBound, false);
|
||||
},
|
||||
enableRightSafety: function () {
|
||||
this.rightSafetyBlock = new Element('div', {'class': 'safetyBlock'});
|
||||
this.rightSafetyBlock.hide();
|
||||
document.body.appendChild(this.rightSafetyBlock);
|
||||
},
|
||||
adjust: function () {
|
||||
if (!this.dhType)
|
||||
this._determineType();
|
||||
@@ -70,6 +84,12 @@ var SOGoDragHandlesInterface = {
|
||||
this.delta = 0;
|
||||
this.origRight = this.rightBlock.offsetLeft - 5;
|
||||
document.body.setStyle({ cursor: "e-resize" });
|
||||
if (this.rightSafetyBlock) {
|
||||
this.rightSafetyBlock.setStyle({
|
||||
top: this.rightBlock.getStyle('top'),
|
||||
left: this.rightBlock.getStyle('left') });
|
||||
this.rightSafetyBlock.show();
|
||||
}
|
||||
} else if (this.dhType == 'vertical') {
|
||||
this.dhLimit = window.height() - 20;
|
||||
this.origY = this.offsetTop;
|
||||
@@ -110,6 +130,8 @@ var SOGoDragHandlesInterface = {
|
||||
this.leftBlock.setStyle({ width: (this.origLeft + deltaX) + 'px' });
|
||||
}
|
||||
this.saveDragHandleState(this.dhType, parseInt(this.leftBlock.getStyle("width")));
|
||||
if (this.rightSafetyBlock)
|
||||
this.rightSafetyBlock.hide();
|
||||
}
|
||||
else if (this.dhType == 'vertical') {
|
||||
var pointerY = Event.pointerY(event);
|
||||
@@ -122,8 +144,6 @@ var SOGoDragHandlesInterface = {
|
||||
deltaY = Math.floor(pointerY - this.origY - (this.offsetHeight / 2));
|
||||
this.lowerBlock.setStyle({ top: (this.origLower + deltaY - this.delta) + 'px' });
|
||||
this.upperBlock.setStyle({ height: (this.origUpper + deltaY - this.delta) + 'px' });
|
||||
//this.lowerBlock.fire("handle:resize");
|
||||
this.upperBlock.fire("handle:resize");
|
||||
this.saveDragHandleState(this.dhType, parseInt(this.lowerBlock.getStyle("top")));
|
||||
}
|
||||
if (Prototype.Browser.IE)
|
||||
|
||||
@@ -360,14 +360,15 @@ function initAddresses() {
|
||||
});
|
||||
}
|
||||
|
||||
/* Overwrites function of MailerUI.js */
|
||||
/* Overwrite function of MailerUI.js */
|
||||
function configureDragHandle() {
|
||||
var handle = $("hiddenDragHandle");
|
||||
if (handle) {
|
||||
handle.addInterface(SOGoDragHandlesInterface);
|
||||
handle.leftMargin = 100;
|
||||
handle.leftBlock=$("leftPanel");
|
||||
handle.rightBlock=$("rightPanel");
|
||||
handle.leftMargin = 135; // minimum width
|
||||
handle.leftBlock = $("leftPanel");
|
||||
handle.rightBlock = $("rightPanel");
|
||||
handle.enableRightSafety();
|
||||
handle.observe("handle:dragged", onWindowResize);
|
||||
}
|
||||
}
|
||||
@@ -436,7 +437,6 @@ function initMailEditor() {
|
||||
|
||||
$("contactFolder").observe("change", onContactFolderChange);
|
||||
|
||||
|
||||
Event.observe(window, "resize", onWindowResize);
|
||||
Event.observe(window, "beforeunload", onMailEditorClose);
|
||||
|
||||
|
||||
@@ -231,4 +231,9 @@ TABLE#filtersList
|
||||
BODY.popup DIV.dialog.none
|
||||
{ left: 50%;
|
||||
width: 350px;
|
||||
margin-left: -175px; }
|
||||
margin-left: -175px; }
|
||||
|
||||
/* SOGoDragHandles */
|
||||
.safetyBlock
|
||||
{ background-color: #fff;
|
||||
filter: alpha(opacity=0); }
|
||||
Reference in New Issue
Block a user