diff options
author | Gabriel-Bowater <gd.bowater@gmail.com> | 2016-01-21 01:45:59 +0300 |
---|---|---|
committer | Gabriel-Bowater <gd.bowater@gmail.com> | 2016-01-21 01:45:59 +0300 |
commit | 68fc05b7461dbc1df8c31f3c19de8da2161bee7f (patch) | |
tree | 665277c7ae4d5639098b7ab24d361cb69e58ed9d /plugins/CoreHome/javascripts/top_controls.js | |
parent | aeb05696fe585b90fed04716fcb73db81a5180d0 (diff) |
top menu calendar navigatable with keyboard.
Diffstat (limited to 'plugins/CoreHome/javascripts/top_controls.js')
-rw-r--r-- | plugins/CoreHome/javascripts/top_controls.js | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/plugins/CoreHome/javascripts/top_controls.js b/plugins/CoreHome/javascripts/top_controls.js index 38b069d6c5..367203110c 100644 --- a/plugins/CoreHome/javascripts/top_controls.js +++ b/plugins/CoreHome/javascripts/top_controls.js @@ -64,4 +64,41 @@ function initTopControls() { } } -}
\ No newline at end of file +} + +$( document ).ready(function() { + $('.periodSelector').keydown(function(e){ + $('.periodSelector .ui-datepicker-month, .periodSelector .ui-datepicker-year, .periodSelector .form-radio, .periodSelector td a').attr('tabindex','4'); + // $('.periodSelector td a').attr('tabindex','4'); + // $('.periodSelector .ui-datepicker-year').attr('tabindex','4'); + // $('.periodSelector .form-radio').attr('tabindex','4'); + + var calendarOpen = $(this).hasClass('expanded'); + + if(e.which==13){ + if(calendarOpen){ + $(this).removeClass('expanded'); + }else{ + $(this).addClass('expanded'); + } + } + }) + + $('.ui-datepicker-month, .ui-datepicker-year, .periodSelector td a').keydown(function(e){ + e.stopPropagation(); + }) + + $('.periodSelector .form-radio').keydown(function(e){ + e.stopPropagation(); + if(e.which==13){ + $('.periodSelector .form-radio').removeClass('checked') + $(this).addClass('checked') + $(this).find('input').click() + + $('.ui-datepicker-month, .ui-datepicker-year, .periodSelector td a').keydown(function(e){ + e.stopPropagation(); + }) + } + }) +}); + |