diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/js/fixmystreet-admin.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/web/js/fixmystreet-admin.js b/web/js/fixmystreet-admin.js index 884ad1c09..02eb30766 100644 --- a/web/js/fixmystreet-admin.js +++ b/web/js/fixmystreet-admin.js @@ -66,6 +66,18 @@ $(function(){ }); } + // On some cobrands the datepicker ends up beneath items in the header, e.g. + // the logo. + // This function sets an appropriate z-index when the datepicker is shown. + // Sadly there's no way to set the z-index when creating the datepicker, so + // we have to run this little helper using the datepicker beforeShow + // handler. + function fixZIndex() { + setTimeout(function() { + $('.ui-datepicker').css('z-index', 10); + }, 0); + } + $( "#start_date" ).datepicker({ defaultDate: "-1w", changeMonth: true, @@ -73,7 +85,8 @@ $(function(){ // This sets the other fields minDate to our date onClose: function( selectedDate ) { $( "#end_date" ).datepicker( "option", "minDate", selectedDate ); - } + }, + beforeShow: fixZIndex }); $( "#end_date" ).datepicker({ /// defaultDate: "+1w", @@ -81,7 +94,8 @@ $(function(){ dateFormat: 'dd/mm/yy' , onClose: function( selectedDate ) { $( "#start_date" ).datepicker( "option", "maxDate", selectedDate ); - } + }, + beforeShow: fixZIndex }); // On user edit page, hide the area/categories fields if body changes |