From 5e0ab6704a6b231fb17d2112d29add7bbf9fa572 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Fri, 3 May 2013 10:59:46 +0800 Subject: [PATCH] MDL-39332 Formslib: remove z-index from calendar panel calendar panel.render() sets zIndex to 0, when calendar is used next to filepicker, it overlaps zIndex should be set by css and not JS, and previously used removeAttr on panel breaks JS on ie8. So solution is to render panel and then remove z-index from dom --- lib/form/yui/dateselector/dateselector.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/form/yui/dateselector/dateselector.js b/lib/form/yui/dateselector/dateselector.js index 5792caecc54..67d35e8ae4e 100644 --- a/lib/form/yui/dateselector/dateselector.js +++ b/lib/form/yui/dateselector/dateselector.js @@ -204,8 +204,11 @@ YUI.add('moodle-form-dateselector', function(Y) { bodyContent : Y.Node.create('
'), id : 'dateselector-calendar-panel' }); - this.panel.removeAttr('zIndex'); // z-index is set by the theme. this.panel.render(document.body); + // zIndex is added by panel.render() and is set to 0. + // Remove zIndex from panel, as this should be set by CSS. This can be done by removeAttr but + // ie8 fails and there is know issue for it. + Y.one('#dateselector-calendar-panel').setStyle('zIndex', null); this.panel.on('heightChange', this.fix_position, this); Y.one('#dateselector-calendar-panel').on('click', function(e){e.halt();});