Sha256: ef5d22e18a421d8414d3dc11b88d2d7e4cff824fdc04378e4d7f1bc3ad3f42c3
Contents?: true
Size: 1.02 KB
Versions: 19
Compression:
Stored size: 1.02 KB
Contents
$(document).ready(function(){ $('#device_attributes').hide(); $('#message_options input[type=radio]').on('change', function(){ if($(this)[0].value == 'broadcast'){ $('#device_attributes').hide(); } else { $('#device_attributes').show(); } }); }); function newMessageAttribute(){ $('#message_attributes_content').append("<%= j render partial: 'jera_push/admin/messages/message_attributes', locals: {key: '', default: false} %>"); }; function removeMessageAttribute(scope){ scope.parent().parent().remove(); }; function addAllDevices(){ var devices = $('#device_list_checkbox tr input'), devices_input = ''; for(var i = 0, l = devices.length; i < l; i++){ var checkboxValue = devices[i].value; devices_input += "<input type='text' name='devices[]' value=" + checkboxValue + " >"; } devices.prop('checked', true); $('#message_devices').append(devices_input); }; function removeAllDevices(){ $('#message_devices').empty(); $('#device_list_checkbox tr input').prop('checked', false); };
Version data entries
19 entries across 19 versions & 1 rubygems