Dantes (обсуждение | вклад) Нет описания правки |
Dantes (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
mw.loader.using('jquery', function () { | mw.loader.using('jquery', function () { | ||
$(function () { | $(function () { | ||
$('.faction-header').each(function () { | |||
this.style.cursor = 'pointer'; | |||
$(this).on('click', function () { | |||
var $list = $(this).next('.faction-list'); | |||
var | $list.slideToggle(150); | ||
if ( | |||
var $arrow = $(this).find('.arrow'); | |||
if ($arrow.text() === '▾') { | |||
$arrow.text('▴'); | |||
} else { | } else { | ||
$arrow.text('▾'); | |||
} | } | ||
}; | }); | ||
} | }); | ||
}); | }); | ||
}); | }); | ||
Версия от 15:54, 8 мая 2025
mw.loader.using('jquery', function () {
$(function () {
$('.faction-header').each(function () {
this.style.cursor = 'pointer';
$(this).on('click', function () {
var $list = $(this).next('.faction-list');
$list.slideToggle(150);
var $arrow = $(this).find('.arrow');
if ($arrow.text() === '▾') {
$arrow.text('▴');
} else {
$arrow.text('▾');
}
});
});
});
});