var checkbox = '#apps-newsletter-subscribe #id_newsletter';
var settings = '#apps-newsletter-subscribe .newsletter-setting';
var agree = '#apps-newsletter-subscribe #id_agree';

if(!$(checkbox).is(':checked')) {
    $(settings).hide(0);
    $(agree).removeAttr('required');
}

$(checkbox).click(function() {
    if($(checkbox).is(':checked')) {
        $(settings).fadeIn();
        $(agree).attr('required', 'required');
    } else {
        $(settings).fadeOut();
        $(agree).removeAttr('required');
    }
});

(function($) {
	var $parent = $('#apps-newsletter-subscribe');
	var $checkbox = $parent.find('#id_newsletter');
	var $settings = $parent.find('.newsletter-setting');
	var $agree = $parent.find('#id_agree');
	var required = 'required';

	if(!$checkbox.is(':checked')) {
	    $settings.hide(0);
	    $agree.removeAttr(required);
	}

	$checkbox.on('click', function() {
	    if($checkbox.is(':checked')) {
	        $settings.fadeIn();
	        $agree.attr(required, required);
	    } else {
	        $settings.fadeOut();
	        $agree.removeAttr(required);
	    }
	});
})(jQuery);
Remove newsletter globals