#250 showing hidden recitations button now works

This commit is contained in:
Hamid Reza Mohammadi 2021-12-01 19:25:43 +03:30
parent ec591172cb
commit c9ba4cdd62
4 changed files with 11 additions and 3 deletions

View File

@ -39,7 +39,7 @@
@if (nRecitationIndex == 4 && Model.Recitations.Length > 5)
{
<a role="button" class="pagebutton" id="load-all-recitations" onclick="">همهٔ خوانش‌ها<i class="info-buttons">autorenew</i></a>
<a role="button" class="pagebutton" id="load-all-recitations" onclick="showAllRecitations()">همهٔ خوانش‌ها<i class="info-buttons">autorenew</i></a>
}
}
</div>

View File

@ -43,7 +43,7 @@ namespace GanjooRazor.Pages
public string CSSClass(int recitationIndex)
{
return recitationIndex < 5 ? "audio-player" : "hidden-item";
return recitationIndex < 5 ? "audio-player" : "hidden-recitation";
}
}
}

View File

@ -1132,6 +1132,6 @@ ol {
}
.hidden-item {
.hidden-recitation {
display: none;
}

View File

@ -895,4 +895,12 @@ function loadMoreRelatedFromPoet(poetId, rhythm, rhymeLetters, skipPoemFullUrl1,
$(data).appendTo(document.getElementById(divId));
},
});
}
function showAllRecitations() {
const hiddenRecitations = document.querySelectorAll('.hidden-recitation');
hiddenRecitations.forEach(function (recitation) {
recitation.className = 'audio-player';
});
document.getElementById('load-all-recitations').style.display = 'none';
}