[PATCH] Don't allow editing time fields when All day is set
-
When
All day [ ]is checked at http://demo.wp-events-plugin.com/submit-your-event/, the time fields are still editable both manually and through timePicker. They also look that way.Suggested changes:
- Prevent manual editing by setting fields readonly when
All day [ ]is checked:$('input#em-time-all-day').change(function(){ if( $('input#em-time-all-day').attr('checked') ){ $('.em-time-input').attr('readonly', true); }else{ $('.em-time-input').attr('readonly', false); } }); - When the fields are readonly, make it be evident to user. I think this part of events-manager.js is attempting that, but doesn’t get called when
All day [ ]is changed://Sort out all day checkbox wrap.find('.em-time-range input.em-time-all-day').change(function(){ var allday = jQuery(this); if( allday.is(':checked') ){ allday.siblings('.em-time-input').css('background-color','#ccc'); }else{ allday.siblings('.em-time-input').css('background-color','#fff'); } }).trigger('change');This should be easy to merge with the patch in #1.
- Disable timePicker for both fields while they are readonly.
- Prevent manual editing by setting fields readonly when
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘[PATCH] Don't allow editing time fields when All day is set’ is closed to new replies.