Nikola auto commit.

Source commit: 723b4018c7
Nikola version: 8.3.3
master
Patricio García 2025-08-24 22:29:27 +01:00
parent 8dd33053e4
commit 276580989d
3 changed files with 18 additions and 12 deletions

View File

@ -2,8 +2,8 @@
* Detect no next Gancio events and deactivate Next events
*/
function GetNextEventsCount() {
const entryComponent = document.querySelector('#nextevents');
function GetNextEventsCount(ge_id) {
const entryComponent = document.querySelector('#' + ge_id);
const shadowRoot = entryComponent.shadowRoot;
const app = shadowRoot.querySelector('div');
if (app != null) {
@ -13,11 +13,11 @@ function GetNextEventsCount() {
}
}
function ActivePastEvents() {
const nexttab = document.getElementById("tab-0");
const next = document.getElementById("tab-pane-0");
const pasttab = document.getElementById("tab-1");
const past = document.getElementById("tab-pane-1");
function ActivePastEvents(tab_next, tab_past) {
const nexttab = document.getElementById("tab-" + tab_next);
const next = document.getElementById("tab-pane-" + tab_next);
const pasttab = document.getElementById("tab-" + tab_past);
const past = document.getElementById("tab-pane-" + tab_past);
if (nexttab != null && next !== null){
next.classList.remove("active");
nexttab.classList.remove("active");
@ -30,8 +30,8 @@ function ActivePastEvents() {
}
}
function ActivePastEventsIfNotNexts() {
if (GetNextEventsCount() == 0) {
ActivePastEvents();
function ActivePastEventsIfNotNexts(ge_id, tab_next, tab_past) {
if (GetNextEventsCount(ge_id) == 0) {
ActivePastEvents(tab_next, tab_past);
}
}

View File

@ -120,6 +120,12 @@ bg-dark
</p>
</div>
@ -221,6 +227,6 @@ bg-dark
for (let i = 0; i < document.forms.length; i++)
document.forms[i].onsubmit = submit;
})();
</script><script src="../assets/js/gancio-events-detect.js"></script><script> $(document).ready(function(){ ActivePastEventsIfNotNexts(); });</script>
</script><script src="../assets/js/gancio-events-detect.js"></script><script> $(document).ready(function(){ ActivePastEventsIfNotNexts("nextevents", "0", "1"); });</script>
</body>
</html>

View File

@ -22,4 +22,4 @@
<script src='/assets/js/gancio-events.es.js'></script>
{{% gancio-events-detect %}}
{{% gancio-events-detect ge_id='nextevents' tab_next='0' tab_past='1' %}}