<commit_before>$(document).ready(function() {
	// ----------------- ajax pagination ---------------
	// will_paginate does not support link attributes yet.
	// See: https://github.com/mislav/will_paginate/pull/100
	$('.pagination a').live('click', function () {
		$.rails.handleRemote($(this));
		return false;
	});

	$('#audits-table-pagination a').live('ajax:success', function (evt, data, statusStr, xhr) {
		$('.audits-table-container').replaceWith(data);
		fixChangesColumnWidth();
	}).live('ajax:error', function () {
		alert("[ERROR] unable to retrieve audits");
	});

	// -------------- fix td.changes width -------------
	var fixChangesColumnWidth = function () {
		var td    = $('td.changes').first();
		var table = td.closest('table');
		var width = table.parent().width() - td.position().left + table.position().left - 5;
		$('td.changes span').width(width);
	};
	fixChangesColumnWidth();
});<commit_msg>Only adjust the audit's table width when it is actually present<commit_after>$(document).ready(function() {
	// ----------------- ajax pagination ---------------
	// will_paginate does not support link attributes yet.
	// See: https://github.com/mislav/will_paginate/pull/100
	$('.pagination a').live('click', function () {
		$.rails.handleRemote($(this));
		return false;
	});

	$('#audits-table-pagination a').live('ajax:success', function (evt, data, statusStr, xhr) {
		$('.audits-table-container').replaceWith(data);
		fixChangesColumnWidth();
	}).live('ajax:error', function () {
		alert("[ERROR] unable to retrieve audits");
	});

	// -------------- fix td.changes width -------------
	var fixChangesColumnWidth = function () {
		var td = $('#audits-table td.changes').first();
		var table = td.closest('table');
		var width = table.parent().width() - td.position().left + table.position().left - 5;
		$('#audits-table td.changes span').width(width);
	};

	if ($('#audits-table').size() > 0)
		fixChangesColumnWidth();
});
{'fraction_non_alphanumeric': 0.2467866323907455, 'fraction_numerical': 0.004627249357326478, 'mean_word_length': 3.2582056892778994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '499412', 'n_tokens_mistral': 616, 'n_tokens_neox': 585, 'n_words': 125}