Make open source
This commit is contained in:
13
app/assets/javascripts/guests.js
Normal file
13
app/assets/javascripts/guests.js
Normal file
@ -0,0 +1,13 @@
|
||||
// Place all the behaviors and hooks related to the matching controller here.
|
||||
// All this logic will automatically be available in application.js.
|
||||
|
||||
$(function () {
|
||||
var radioMatcher = '#guest-edit-form input[name="guest[attending]"]'
|
||||
var radioButtons = $(radioMatcher)
|
||||
function toggleAttendingOnly () {
|
||||
var attending = $(radioMatcher + ':checked').val()
|
||||
$('.guest-attending-only textarea').attr('disabled', attending !== 'true')
|
||||
}
|
||||
radioButtons.on('change', toggleAttendingOnly)
|
||||
toggleAttendingOnly()
|
||||
})
|
Reference in New Issue
Block a user