parent
8dd33053e4
commit
276580989d
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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' %}}
|
||||||
|
|
Loading…
Reference in New Issue