Created
June 30, 2016 16:56
-
-
Save Riveascore/389d32732fc03c531ab5ab2005e1bce2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setupConflict(siteId, roomId, dateString) { | |
var locationSelector, roomSelector, $unselectable, $dateInput; | |
locationSelector = '#facility_request_every_facility_request_section_attributes_0_attributes_to_build_facility_request_parts_site_id_' + siteId; | |
roomSelector = '#facility_request_every_facility_request_section_attributes_0_attributes_to_build_facility_request_parts_room_ids_' + roomId + '_'; | |
$(document).on('rooms-loaded', function (event) { | |
$(roomSelector).prop('checked', true); | |
$(roomSelector).change(); | |
$('.room-notes').slideUp(); | |
setTimeout(function () { | |
$dateInput = $('#facility_request_every_facility_request_section_attributes_0_attributes_to_build_facility_request_parts_dates'); | |
$dateInput.val(dateString); | |
$dateInput.closest('.form-group').parent().show(); | |
}, 1000); | |
}); | |
$(locationSelector).prop('checked', true); | |
$(locationSelector).change(); | |
$('#facility_request_every_facility_request_section_attributes_0_attributes_to_build_facility_request_parts_start_time').val("07:00"); | |
$('#facility_request_every_facility_request_section_attributes_0_attributes_to_build_facility_request_parts_end_time').val("21:00"); | |
} | |
$(document).ready(function() { | |
setupConflict(35, 279, "06/28/2016,06/29/2016,06/30/2016"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment