From 2b1a8f6b30f8efb9968d3bc25d99ae4935d9a577 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 14 Mar 2012 14:38:57 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 377f173bfaa310b58f7ebe5b7fb0f70204cbb0e5 Monotone-Revision: 1eadd109045fc1edf90a763470ff31e5ad34bebf Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2012-03-14T14:38:57 --- ChangeLog | 10 +++++++ UI/WebServerResources/SOGoTimePicker.js | 28 +++++++++++-------- UI/WebServerResources/UIxAppointmentEditor.js | 4 +++ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c860e461..03d11afef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2012-03-14 Francis Lachapelle + + * UI/WebServerResources/SOGoTimePicker.js (position): new method + to be able to recompute the position of the widget. + + * UI/WebServerResources/UIxAppointmentEditor.js + (refreshAttendees): when changing the attendees, we recompute the + position of the time pickers because the attendees link could + shift up or down the time fields. + 2012-03-13 Francis Lachapelle * UI/WebServerResources/UIxFilterEditor.js (savePreferences): diff --git a/UI/WebServerResources/SOGoTimePicker.js b/UI/WebServerResources/SOGoTimePicker.js index 68dfaafcb..a1317eb2d 100644 --- a/UI/WebServerResources/SOGoTimePicker.js +++ b/UI/WebServerResources/SOGoTimePicker.js @@ -84,6 +84,22 @@ var SOGoTimePickerInterface = { inner.appendChild(new Element("hr")); // Compute position + this.position(); + + // Register observers + this.on("click", this.toggleVisibility.bindAsEventListener(this)); + this.on("change", this.onChange.bindAsEventListener(this)); + this.on("keydown", this.onKeydown.bindAsEventListener(this)); + this.div.on("mouseenter", this.onEnter.bindAsEventListener(this)); + this.div.on("mouseleave", this.onLeave.bindAsEventListener(this)); + this.disposeHandler = $(document.body).on("click", this.onDispose.bindAsEventListener(this)); + this.disposeHandler.stop(); + + // Apply current input value if defined + this.onChange(); + }, + + position: function () { var inputPosition = this.cumulativeOffset(); var inputDimensions = this.getDimensions(); var divWidth = this.div.getWidth(); @@ -98,18 +114,6 @@ var SOGoTimePickerInterface = { this.div.setStyle({ top: top+"px", left: left+"px", backgroundPosition: arrow+'px top'}); - - // Register observers - this.on("click", this.toggleVisibility.bindAsEventListener(this)); - this.on("change", this.onChange.bindAsEventListener(this)); - this.on("keydown", this.onKeydown.bindAsEventListener(this)); - this.div.on("mouseenter", this.onEnter.bindAsEventListener(this)); - this.div.on("mouseleave", this.onLeave.bindAsEventListener(this)); - this.disposeHandler = $(document.body).on("click", this.onDispose.bindAsEventListener(this)); - this.disposeHandler.stop(); - - // Apply current input value if defined - this.onChange(); }, onHourClick: function (event) { diff --git a/UI/WebServerResources/UIxAppointmentEditor.js b/UI/WebServerResources/UIxAppointmentEditor.js index f5091275a..f9189d3bc 100644 --- a/UI/WebServerResources/UIxAppointmentEditor.js +++ b/UI/WebServerResources/UIxAppointmentEditor.js @@ -413,6 +413,10 @@ function refreshAttendees(newAttendees) { // Hide link of attendees attendeesLabel.setStyle({ display: "none" }); } + + // Recompute the position of the time picker widgets + window.timeWidgets['start']['time'].position(); + window.timeWidgets['end']['time'].position(); } function setupAttendeeNode(aNode, aAttendee, isDelegate) {