1"use strict"; 2 3(function ($) { 4 $(document).ready(function () { 5 var $tr = $('body.settings.notifications #buddypress .standard-form .notification-settings tbody tr'); 6 $tr.each(function () { 7 notifications_toggle($(this), false); 8 }); 9 $tr.on('click', function () { 10 notifications_toggle($(this), true); 11 }); 12 }); 13 function notifications_toggle($item, justCheck) { 14 console.log(justCheck); 15 var $yes = $item.find('.yes input[type="radio"]'); 16 var $no = $item.find('.no input[type="radio"]'); 17 var is_yes = $yes.is(':checked'); 18 var is_no = $no.is(':checked'); 19 if (is_yes) { 20 if (justCheck) { 21 $item.closest('tr').addClass('checked-no').removeClass('checked-yes'); 22 $no.prop('checked', true); 23 } else { 24 $item.closest('tr').addClass('checked-yes'); 25 } 26 } 27 if (is_no) { 28 if (justCheck) { 29 $item.closest('tr').addClass('checked-yes').removeClass('checked-no'); 30 $yes.prop('checked', true); 31 } else { 32 $item.closest('tr').addClass('checked-no'); 33 } 34 } 35 return; 36 } 37})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.