From 605891b28e28ad047a0a7bef0654c88f9821427e Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 28 Sep 2009 13:40:37 +0000 Subject: [PATCH] Updated datepicker to position every time in dynamic layouts git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14374 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/include/datepicker.init.js | 16 ---------------- gosa-core/html/include/datepicker.js | 2 ++ 2 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 gosa-core/html/include/datepicker.init.js diff --git a/gosa-core/html/include/datepicker.init.js b/gosa-core/html/include/datepicker.init.js deleted file mode 100644 index 77457bed0..000000000 --- a/gosa-core/html/include/datepicker.init.js +++ /dev/null @@ -1,16 +0,0 @@ -function initDatepickers() { - $$("*").findAll(function(node) { - return Element.hasClassName(node,'date'); - }).each(function(node) { - datepickers[node.id] = new DatePicker({ - relative : node.id, - language : 'de', - enableCloseEffect : false, - enableShowEffect : true, - closeEffect : 'squish', - showEffect : 'appear' - }); - datepickers[node.id].setDateFormat([ "dd", "mm", "yyyy" ], "."); - }); -} -Event.observe(window, 'load', initDatepickers, false); diff --git a/gosa-core/html/include/datepicker.js b/gosa-core/html/include/datepicker.js index aee1ea51b..738324708 100644 --- a/gosa-core/html/include/datepicker.js +++ b/gosa-core/html/include/datepicker.js @@ -425,6 +425,8 @@ DatePicker.prototype = { /* init the datepicker if it doesn't exists */ if ( $(this._id_datepicker) == null ) this.load(); + var a_pos = Element.cumulativeOffset($(this._relative)); + this.setPosition(a_pos[1], a_pos[0]); if (!this._isPositionned && this._relativePosition) { /* position the datepicker relatively to element */ var a_lt = Element.positionedOffset($(this._relative)); -- 2.30.2