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) {