var intId = setInterval( function() {
if ( $(".resheader").length == 0 ) {
return;
}
clearInterval(intId);
$('#restabs a').click(function (e) {
e.preventDefault();
$(this).tab('show');
return false;
})
$(".errors div[data-id]").each(function(i) {
var self = $(this);
self.closest('.rescontainer').find("table tbody td.bad[data-error=\"" + self.attr('data-id') + "\"]").popover({
placement: 'top',
trigger: 'hover',
html: true,
container: self.closest('.rescontainer'),
content: self.html()
});
});
var stateRes = false;
$('#btnHidebad').click(function() {
if ( stateRes ) {
$('.rescontainer table tr.bad').show();
$(this).button('reset');
} else {
$('.rescontainer table tr.bad').hide();
$(this).button('show');
}
stateRes = ! stateRes;
});
$('.rescontainer .btnSelectall').click(function() {
$(this).closest('.rescontainer').find('table input:checkbox').prop('checked', true);
});
$('.rescontainer .btnSelectgood').click(function() {
$(this).closest('.rescontainer').find('table input:checkbox').prop('checked', true);
$(this).closest('.rescontainer').find('table tr.bad input:checkbox').prop('checked', false);
});
$('.rescontainer .btnClear').click(function() {
$(this).closest('.rescontainer').find('table input:checkbox').prop('checked', false);
});
}, 100);