From a5e83e3f23a6f5e7cbe7987879f0cad906562b7e Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 15 Mar 2012 19:17:25 +0000 Subject: [PATCH] See ChangeLog. Monotone-Parent: 83140ea045c02e9961515cc478033e97df559cfb Monotone-Revision: e4e20cbfe1ccdc91e3f5a7fe6041b89f791885c4 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-03-15T19:17:25 --- ChangeLog | 7 +++++++ UI/WebServerResources/SOGoDragHandles.js | 24 ++++++++++++++++++++++-- UI/WebServerResources/UIxMailEditor.js | 10 +++++----- UI/WebServerResources/iefixes.css | 7 ++++++- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfa6d0b8a..432c50c3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-03-15 Francis Lachapelle + + * 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 * UI/MailerUI/UIxMailFolderActions.m (-deleteAction): we now diff --git a/UI/WebServerResources/SOGoDragHandles.js b/UI/WebServerResources/SOGoDragHandles.js index b0b9ebb96..cfc6ef304 100644 --- a/UI/WebServerResources/SOGoDragHandles.js +++ b/UI/WebServerResources/SOGoDragHandles.js @@ -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) diff --git a/UI/WebServerResources/UIxMailEditor.js b/UI/WebServerResources/UIxMailEditor.js index e092a4577..0f12384e2 100644 --- a/UI/WebServerResources/UIxMailEditor.js +++ b/UI/WebServerResources/UIxMailEditor.js @@ -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); diff --git a/UI/WebServerResources/iefixes.css b/UI/WebServerResources/iefixes.css index 2f17386c1..7d545b4a5 100644 --- a/UI/WebServerResources/iefixes.css +++ b/UI/WebServerResources/iefixes.css @@ -231,4 +231,9 @@ TABLE#filtersList BODY.popup DIV.dialog.none { left: 50%; width: 350px; - margin-left: -175px; } \ No newline at end of file + margin-left: -175px; } + +/* SOGoDragHandles */ +.safetyBlock +{ background-color: #fff; + filter: alpha(opacity=0); } \ No newline at end of file