Sha256: ce0e75731520a0cf944125bf001a914eac3428ba873de32b56d76d914f50bdf4
Contents?: true
Size: 791 Bytes
Versions: 31
Compression:
Stored size: 791 Bytes
Contents
$(document).ready(function() { var disable = function($element) { $element.hide(); $element.find('input').prop('disabled', true); }; var enable = function($element) { $element.show(); $element.find('input').prop('disabled', false); }; var updateMessageForm = function() { var $type = $('[name="message[type]"]'); if (typeof $type === 'undefined') { return; } $recipients = $('.message_recipients'); $trigger = $('.message_trigger'); var type = $type.val(); if (type === "automated") { disable($recipients); enable($trigger); } else { disable($trigger); enable($recipients); } }; updateMessageForm(); $('[name="message[type]"]').on('change', function() { updateMessageForm(); }); });
Version data entries
31 entries across 31 versions & 1 rubygems