「MediaWiki:Common.js」の版間の差分

Tmyt105 (トーク) による版 1180 を取り消し
編集の要約なし
2行目: 2行目:




function hideShortDesc() {
const subtitle = document.getElementById('mw-content-subtitle');
    const shortdescElement = document.getElementById('contentSub');
 
     if (shortdescElement && shortdescElement.classList.contains('ext-shortdesc')) {
if (subtitle) {
         shortdescElement.style.display = 'none';
  const childNodes = subtitle.childNodes;
  for (let i = 0; i < childNodes.length; i++) {
    const node = childNodes[i];
     if (node.nodeType === Node.TEXT_NODE) {
      if (node.textContent.trim().length > 0) {
         subtitle.removeChild(node);
      }
     }
     }
  }
}
}
hideShortDesc();