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

View File

@ -118,6 +118,12 @@ bg-dark
<script src="../assets/js/gancio-events.es.js"></script><p> <script src="../assets/js/gancio-events.es.js"></script><p>
</p> </p>
@ -221,6 +227,6 @@ bg-dark
for (let i = 0; i < document.forms.length; i++) for (let i = 0; i < document.forms.length; i++)
document.forms[i].onsubmit = submit; 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> </body>
</html> </html>

View File

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