HTML
Результаты
JS
$(".ViewResult").on("click", function(event) {
let el = $(event.target.closest(".ViewResult"))
let index = parseInt(el.attr("data-index"))
Api.DownloadResult(index).then((res) => {
$('.spoiler_bg').text(res);
$(".spoiler_bg").html($(".spoiler_bg").html().replace(/\n/g,''));
})
});
$(document).ready(function(){
$('.spoiler_title').on('click', function(){
$('.spoiler_toggle').slideToggle();
return false;
});
$('.spoiler_indicator').on('click', function(){
$('.spoiler_bg').text('');
});
CSS
.spoiler_indicator {
float: right;
}
.spoiler_title {
display:block;
background-color: #551A8B;
color: #fff;
padding: 10px 10px;
}
.spoiler_toggle {
display:none;
}
.spoiler_bg {
background: #9C6AC9;
padding: 5px 5px;
overflow: auto;
max-height: 100px;
}