From 4598fb651bceb9361daad2ea12912f1dc6bfa8a2 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Mon, 20 Sep 2010 03:33:18 +0000 Subject: [PATCH] mforms-dateselector MDL-24234 date selector no longer disables the select boxes and updates itself when user uses the selects rather than the component. --- .../assets/skins/sam/dateselector.css | 2 -- lib/form/yui/dateselector/dateselector.js | 16 ++-------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/form/yui/dateselector/assets/skins/sam/dateselector.css b/lib/form/yui/dateselector/assets/skins/sam/dateselector.css index d5b39ba5dbf..01a37e75dd8 100644 --- a/lib/form/yui/dateselector/assets/skins/sam/dateselector.css +++ b/lib/form/yui/dateselector/assets/skins/sam/dateselector.css @@ -1,5 +1,3 @@ -.dateselector-select-mask-point {background-color:transparent;position:absolute;width:0;display:inline;} -.dateselector-select-mask-point .dateselector-select-mask {background-color:#FFF;position:relative;} #dateselector-calendar-panel {background-color:#999;border-bottom:3px solid #999;border-right:3px solid #999;} #dateselector-calendar-content {border:1px solid #666;margin-top:-3px;margin-left:-3px;} body.ie #dateselector-calendar-panel.yui3-overlay-hidden table {display:none;} \ No newline at end of file diff --git a/lib/form/yui/dateselector/dateselector.js b/lib/form/yui/dateselector/dateselector.js index c116687c55f..68d41abc8da 100644 --- a/lib/form/yui/dateselector/dateselector.js +++ b/lib/form/yui/dateselector/dateselector.js @@ -104,24 +104,12 @@ YUI.add('moodle-form-dateselector', function(Y) { node.on('blur', this.blur_event, this); return; } - node.maskDiv = Y.Node.create('
'); - node.maskDiv.on('click', this.focus_event, this); - node.ancestor().insert( - Y.Node.create('
').append( - node.maskDiv.setStyles({ - width : node.get('offsetWidth')+'px', - height : node.get('offsetHeight')+'px', - opacity : 0 - })), node); + node.on('click', this.focus_event, this); + node.after('change', this.set_date_from_selects, this); }, this); if (this.yearselect && this.monthselect && this.dayselect) { this.enablecheckbox = this.get('node').one('input'); - if (this.enablecheckbox) { - this.enablecheckbox.on('focus', this.focus_event, this); - this.enablecheckbox.on('change', this.focus_event, this); - this.enablecheckbox.on('blur', this.blur_event, this); - } } }, focus_event : function(e) {