MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 4: | Line 4: | ||
document.addEventListener("DOMContentLoaded", function() { | document.addEventListener("DOMContentLoaded", function() { | ||
var count = | var count = 1; | ||
document.querySelectorAll('.btn.btn-primary.places-button').forEach(function(button) { | document.querySelectorAll('.btn.btn-primary.places-button').forEach(function(button) { | ||
var uniqueId = 'details- | var uniqueId = 'details-places-' + count; | ||
var collapseDiv = button.parentElement.nextElementSibling; | var collapseDiv = button.parentElement.nextElementSibling; | ||
if (collapseDiv) { | if (collapseDiv) { | ||
Revision as of 06:46, 27 June 2024
importScriptURI('https://code.jquery.com/jquery-3.5.1.min.js');
importScriptURI('https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js');
importScriptURI('https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js');
document.addEventListener("DOMContentLoaded", function() {
var count = 1;
document.querySelectorAll('.btn.btn-primary.places-button').forEach(function(button) {
var uniqueId = 'details-places-' + count;
var collapseDiv = button.parentElement.nextElementSibling;
if (collapseDiv) {
collapseDiv.id = uniqueId;
button.setAttribute('data-target', '#' + uniqueId);
button.setAttribute('aria-controls', uniqueId);
count++;
}
});
});