MediaWiki:Mobile.js: Difference between revisions

no edit summary
(refactoring expandables (templates & javascript) (better fallback and nestability))
No edit summary
Line 41: Line 41:
}
}


function showOnlyNext(ev) { // for expandable text:
function showOnlyNext(ev) { // for expandable text
  ev.target.style.display = "none";
  ev.currentTarget.style.display = "none";
  ev.target.nextElementSibling.style.display = "initial";
  ev.currentTarget.nextElementSibling.style.display = "initial";
  ev.stopPropagation();
  ev.stopPropagation();
}
}
function showOnlyPrev(ev) {
function showOnlyPrev(ev) {
  ev.target.style.display = "none";
  ev.currentTarget.style.display = "none";
  ev.target.previousElementSibling.style.display = "initial";
  ev.currentTarget.previousElementSibling.style.display = "initial";
  ev.stopPropagation();
  ev.stopPropagation();
}
}