' +
'' +
''
// @formatter:on
/* beautify preserve:end */
),
beforeRenderItems: function (event, data) {
// Filter form 3,4,5
data.items = $.grep(data.items, function (item) {
return $.inArray(item.type, ['3', '4', '5']) === -1;
});
$.each(data.items, function (i, item) {
// Filter allowed documents
item.docs = item.docs.filter(function (doc) {
return secConfig.docFilters.indexOf(doc.docType) >= 0;
});
// add document class and type
item.docs = $.map(item.docs, function (doc) {
return $.extend({}, doc, secConfig.docTypes[doc.docType]);
});
});
},
itemsComplete: function (e) {
var widget = e.target,
$pagination = $('.ftbl', widget).html('');
$('.pagination_display').html('');
// Utilize paging function from FootableJS library
$('.irwFilingOthers .irwResponsiveTable', widget).footable({
paging: {
container: $pagination,
strings: {
prev: '
',
next: '
',
first: '',
last: ''
},
position: 'center',
size: 20,
countFormat: 'Displaying {PF} to {PL} (of {TR} filings)',
limit: 5,
},
'on': {
'postdraw.ft.table': function (e, ft) {
$('.ftbl .pagination').addClass('IrwPaginationCustom');
$('[data-page="first"], [data-page="last"], [data-page="prev-limit"], [data-page="next-limit"]').remove();
$('.footable-page-link').addClass('btn btn-default');
$('.footable-page.active > a').addClass('btn-primary');
$('.ftbl .label').appendTo('.pagination_display');
},
'after.ft.paging': function () {
$('.footable-page > a').removeClass('btn-primary');
$('.footable-page.active > a').addClass('btn-primary');
}
}
});
},
complete: function (e) {
var $widget = $(this);
// Re-render widget via filing group
$widget.find('#filtertypeDropdown').on('change', function () {
var types = $(this).val().split(',');
$widget.sec('option', 'filingGroups', types);
$widget.sec('reloadItems');
});
// On click trigger to show downloadable documents
$widget.on('click', '.irwFilingDownloadTrigger', function () {
var $this = $(this);
var $sibling = $this.next();
if ($sibling.hasClass('show')) {
$this.removeClass('text-primary').next().removeClass('show').closest('td').removeClass('bg-default');
} else {
$('.irwFilingDownloadTrigger').not(this).removeClass('text-primary').next().removeClass('show').closest('td').removeClass('bg-default');
$this.addClass('text-primary').next().addClass('show').closest('td').addClass('bg-default');
}
});
// Hide document download box on document click
$(document).on('click', function (e) {
if (!$(e.target).closest('.irwFilingDownloadTrigger').length) {
$('.irwFilingDownloadTrigger').removeClass('text-primary').next().removeClass('show').closest('td').removeClass('bg-default');
}
});
// Search
// Uses Search Results 5.23.0. Needs to use V2 and site is indexed.
$('#searchTextbox').on('keypress', function (e) {
if ((e.keyCode || e.which) === 13) {
e.preventDefault();
secConfig.searchSEC($(this).val());
}
});
$('#docsSearchIcon').on('click', function (e) {
e.preventDefault();
secConfig.searchSEC($(this).parent().find('input').val());
});
}
});