From 8d9364f64440f4c0c625f2447f4658d4d821731e Mon Sep 17 00:00:00 2001 From: carlgmathisen <> Date: Sun, 2 Nov 2008 23:56:37 +0000 Subject: Issue #29 --- .../source/prado/datepicker/datepicker.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'framework/Web/Javascripts') diff --git a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js index 834e89cf..13637f6d 100644 --- a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js +++ b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js @@ -67,6 +67,7 @@ Prado.WebUI.TDatePicker.prototype = this.weekSlot = new Array(6); this.minimalDaysInFirstWeek = 4; this.selectedDate = this.newDate(); + this.positionMode = 'Bottom'; //which element to trigger to show the calendar if(this.options.Trigger) @@ -79,6 +80,12 @@ Prado.WebUI.TDatePicker.prototype = this.trigger = this.control; var triggerEvent = this.options.TriggerEvent || "focus"; } + + // Popup position + if(this.options.PositionMode == 'Top') + { + this.positionMode = this.options.PositionMode; + } Object.extend(this,options); @@ -309,8 +316,8 @@ Prado.WebUI.TDatePicker.prototype = if(this.iePopUp) { this.iePopUp.style.display = "block"; - this.iePopUp.style.top = (this._calDiv.offsetTop -1 ) + "px"; this.iePopUp.style.left = (this._calDiv.offsetLeft -1)+ "px"; + this.iePopUp.style.top = (this._calDiv.offsetTop -1 ) + "px"; this.iePopUp.style.width = Math.abs(this._calDiv.offsetWidth -2)+ "px"; this.iePopUp.style.height = (this._calDiv.offsetHeight + 1)+ "px"; if(cleanup) this.iePopUp.style.display = "none"; @@ -602,10 +609,17 @@ Prado.WebUI.TDatePicker.prototype = { var pos = this.control.positionedOffset(); - pos[1] += this.getDatePickerOffsetHeight(); - + if(this.positionMode=='Top') + { + pos[1] = (document.body.clientHeight - pos[1]); + this._calDiv.style.bottom = (pos[1]-1) + "px"; + } + else + { + pos[1] += this.getDatePickerOffsetHeight(); + this._calDiv.style.top = (pos[1]-1) + "px"; + } this._calDiv.style.display = "block"; - this._calDiv.style.top = (pos[1]-1) + "px"; this._calDiv.style.left = pos[0] + "px"; this.ieHack(false); -- cgit v1.2.3