/** * Make elastic search tables display two rows of the last column * and allow for a show more button. */ (function ($) { $(function () { var window_height = $(window).height() || 0, header_height = $('#navigation').outerHeight() || 0, footer_height = ($('#footer').outerHeight() || 0) + ($('.main-footer').outerHeight() || 0); $('#main').css('min-height', window_height - (header_height + footer_height) - 30); $('#elasticsearch_hits_table tr td:nth-of-type(2)').each(function () { var text = $(this).html(); var array = text.split('
'); if (array.length > 2) { var div = $('
', {}); div.append(array.shift() + '
' + array.shift()); var hidden = $('
', {'class': 'hidden-hit'}).css('display', 'none'); hidden.append(array.join('
')); div.append(hidden); div.append('
'); var btn = $('