diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2014-07-03 13:40:55 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2014-07-03 13:40:55 +0200 |
commit | dea51607988690162a098079f46d0a48d62adb13 (patch) | |
tree | 631920d2990fd4d887b8e8fe6b72c001630f9ffc /plugins | |
parent | 793fa9876a55bd21fe515725107b458b1b416670 (diff) |
Fix datepicker accessibility extension
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/jqueryui/js/jquery-ui-1.10.4.custom.min.js | 7 | ||||
-rw-r--r-- | plugins/jqueryui/js/jquery-ui-accessible-datepicker.js | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/plugins/jqueryui/js/jquery-ui-1.10.4.custom.min.js b/plugins/jqueryui/js/jquery-ui-1.10.4.custom.min.js index d7c9e5982..1fc30a166 100755 --- a/plugins/jqueryui/js/jquery-ui-1.10.4.custom.min.js +++ b/plugins/jqueryui/js/jquery-ui-1.10.4.custom.min.js @@ -89,13 +89,14 @@ $.extend($.datepicker, { .attr('aria-labelledby', inst.id + '-dp-title'); } else { - inst.dpDiv.attr('id', inst.id + '-dp-widget') + var widgetId = inst.dpDiv.attr('id') || inst.id + '-dp-widget'; + inst.dpDiv.attr('id', widgetId) .attr('aria-hidden', 'true') .attr('aria-labelledby', inst.id + '-dp-title'); $(inst.input).attr('aria-haspopup', 'true') .attr('aria-expanded', 'false') - .attr('aria-owns', inst.id + '-dp-widget'); + .attr('aria-owns', widgetId); } return inst; @@ -108,7 +109,7 @@ $.extend($.datepicker, { var that = this; // register additional keyboard events to control date selection with cursor keys - $(target).bind('keyup', function(event) { + $(target).unbind('keyup.datepicker-extended').bind('keyup.datepicker-extended', function(event) { var inc = 1; switch (event.keyCode) { case 109: diff --git a/plugins/jqueryui/js/jquery-ui-accessible-datepicker.js b/plugins/jqueryui/js/jquery-ui-accessible-datepicker.js index ae6ba3751..287c8f576 100644 --- a/plugins/jqueryui/js/jquery-ui-accessible-datepicker.js +++ b/plugins/jqueryui/js/jquery-ui-accessible-datepicker.js @@ -74,13 +74,14 @@ $.extend($.datepicker, { .attr('aria-labelledby', inst.id + '-dp-title'); } else { - inst.dpDiv.attr('id', inst.id + '-dp-widget') + var widgetId = inst.dpDiv.attr('id') || inst.id + '-dp-widget'; + inst.dpDiv.attr('id', widgetId) .attr('aria-hidden', 'true') .attr('aria-labelledby', inst.id + '-dp-title'); $(inst.input).attr('aria-haspopup', 'true') .attr('aria-expanded', 'false') - .attr('aria-owns', inst.id + '-dp-widget'); + .attr('aria-owns', widgetId); } return inst; @@ -93,7 +94,7 @@ $.extend($.datepicker, { var that = this; // register additional keyboard events to control date selection with cursor keys - $(target).bind('keyup', function(event) { + $(target).unbind('keyup.datepicker-extended').bind('keyup.datepicker-extended', function(event) { var inc = 1; switch (event.keyCode) { case 109: |