MediaWiki:Common.js: diferenças entre revisões
Aparência
Sem resumo de edição |
Sem resumo de edição |
||
| Linha 3: | Linha 3: | ||
$('.list-equip .button').each(function () { | $('.list-equip .button').each(function () { | ||
var $button = $(this); | var $button = $(this); | ||
var $ | |||
// encontra o bloco pai correto | |||
var $container = $button.closest('.list-equip'); | |||
// procura o detalhe logo a seguir ao bloco inteiro | |||
var $details = $container.next('.tabber-noactive'); | |||
if (!$details.length) { | if (!$details.length) { | ||
| Linha 14: | Linha 19: | ||
$button.off('click.equipdetails').on('click.equipdetails', function () { | $button.off('click.equipdetails').on('click.equipdetails', function () { | ||
$details.slideToggle(150); | $details.stop(true, true).slideToggle(150); | ||
$button.text($details.is(':visible') ? 'Ocultar' : 'Detalhes'); | $button.text($details.is(':visible') ? 'Ocultar' : 'Detalhes'); | ||
}); | }); | ||
Revisão das 18h29min de 29 de março de 2026
mw.loader.using('mediawiki.util').then(function () {
$(function () {
$('.list-equip .button').each(function () {
var $button = $(this);
// encontra o bloco pai correto
var $container = $button.closest('.list-equip');
// procura o detalhe logo a seguir ao bloco inteiro
var $details = $container.next('.tabber-noactive');
if (!$details.length) {
return;
}
$details.hide();
$button.css('cursor', 'pointer');
$button.off('click.equipdetails').on('click.equipdetails', function () {
$details.stop(true, true).slideToggle(150);
$button.text($details.is(':visible') ? 'Ocultar' : 'Detalhes');
});
});
});
});