122
edits
No edit summary |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* Load Popper.js */ | /* Load Popper.js */ | ||
mw.loader.load('https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js'); | mw.loader.load('https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js'); | ||
| Line 8: | Line 5: | ||
mw.loader.load('https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js'); | mw.loader.load('https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js'); | ||
function initializePlacesButtons() { | |||
var count = 1; | var count = 1; | ||
document.querySelectorAll('.btn.btn-primary.places-button').forEach(function(button) { | document.querySelectorAll('.btn.btn-primary.places-button').forEach(function(button) { | ||
| Line 18: | Line 15: | ||
button.setAttribute('aria-controls', uniqueId); | button.setAttribute('aria-controls', uniqueId); | ||
count++; | count++; | ||
} | } | ||
}); | |||
} | |||
if (document.readyState !== 'loading') { | |||
initializePlacesButtons(); | |||
} else { | |||
document.addEventListener('DOMContentLoaded', function () { | |||
initializePlacesButtons(); | |||
}); | }); | ||
} | } | ||