parent
8dd33053e4
commit
276580989d
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,6 +118,12 @@ bg-dark
|
|||
|
||||
<script src="../assets/js/gancio-events.es.js"></script><p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
@ -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>
|
||||
|
|
|
@ -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' %}}
|
||||
|
|
Loading…
Reference in New Issue