MediaWiki:Mobile.js: различия между версиями

нет описания правки
Нет описания правки
Метки: с мобильного устройства из мобильной версии
Нет описания правки
Метки: с мобильного устройства из мобильной версии
Строка 51: Строка 51:


// свернуть все заголовки
// свернуть все заголовки
console.log('Mediawiki:Mobile.js', 3);
console.log('Mediawiki:Mobile.js', 4);
var headings = document.querySelector('.section-heading.open-block');
var headings = document.querySelector('.section-heading[aria-expanded="true"]');
console.log('>> headings', headings);
console.log('>> headings', headings);
document.addEventListener('DOMContentLoaded', function() {
  var sections = document.querySelectorAll('.section-heading[aria-expanded="true"]');
  sections.forEach(function(section) {
    section.click();
  });
});
document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMContentLoaded", function() {
console.log('DOMContentLoaded');
var headings = document.querySelector('.section-heading.open-block');
console.log('>> headings', headings);


headings.forEach(function(h){
// console.log('DOMContentLoaded');
h.click();
// var headings = document.querySelector('.section-heading.open-block');
});
// console.log('>> headings', headings);
 
// headings.forEach(function(h){
// h.click();
// });
});
});