From: cajus Date: Mon, 28 Sep 2009 13:40:37 +0000 (+0000) Subject: Updated datepicker to position every time in dynamic layouts X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=605891b28e28ad047a0a7bef0654c88f9821427e;p=gosa.git 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 --- 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));