MediaWiki:Gadget-collapsibleAdvancedSearch.js: Difference between revisions
From WikiMSK
(Created page with "function docReady(fn) { // see if DOM is already available if (document.readyState === "complete" || document.readyState === "interactive") { // call on next a...") |
No edit summary |
||
Line 13: | Line 13: | ||
function collapsibleHeadings() { | function collapsibleHeadings() { | ||
var headings = document.querySelectorAll('#mw-searchoptions'); | var headings = document.querySelectorAll('#mw-searchoptions'); | ||
Array.prototype.forEach.call(headings, function (heading) { | Array.prototype.forEach.call(headings, function (heading) { | ||
heading.innerHTML = ""; | |||
}); | |||
} | } |
Latest revision as of 15:40, 19 April 2021
function docReady(fn) {
// see if DOM is already available
if (document.readyState === "complete" || document.readyState === "interactive") {
// call on next available tick
setTimeout(fn, 1);
} else {
document.addEventListener("DOMContentLoaded", fn);
}
}
docReady(collapsibleHeadings);
function collapsibleHeadings() {
var headings = document.querySelectorAll('#mw-searchoptions');
Array.prototype.forEach.call(headings, function (heading) {
heading.innerHTML = "";
});
}