Mediawiki:common.js
| Строка 285: | Строка 285: | ||
if (wrapper.classList.contains('collapsed')) { | if (wrapper.classList.contains('collapsed')) { | ||
wrapper.style.maxHeight = wrapper.scrollHeight + 'px'; | wrapper.style.maxHeight = wrapper.scrollHeight + 'px'; | ||
wrapper.classList.remove('collapsed'); | wrapper.classList.remove('collapsed'); | ||
| Строка 291: | Строка 290: | ||
if (btn) btn.textContent = 'свернуть'; | if (btn) btn.textContent = 'свернуть'; | ||
var cleanup = function() { | var cleanup = function() { | ||
wrapper.style.maxHeight = ''; | wrapper.style.maxHeight = ''; | ||
| Строка 298: | Строка 296: | ||
wrapper.addEventListener('transitionend', cleanup); | wrapper.addEventListener('transitionend', cleanup); | ||
} else { | } else { | ||
var currentHeight = wrapper.scrollHeight; | var currentHeight = wrapper.scrollHeight; | ||
wrapper.style.maxHeight = currentHeight + 'px'; | wrapper.style.maxHeight = currentHeight + 'px'; | ||
wrapper.offsetHeight; | wrapper.offsetHeight; | ||
wrapper.style.maxHeight = '0px'; | wrapper.style.maxHeight = '0px'; | ||
| Строка 333: | Строка 329: | ||
} | } | ||
})(); | })(); | ||