5737
редагувань
Admin (обговорення | внесок) Немає опису редагування |
Admin (обговорення | внесок) Немає опису редагування |
||
| Рядок 252: | Рядок 252: | ||
var $tabs = $('.player-tab'); | var $tabs = $('.player-tab'); | ||
var $contents = $('.player-tab-content'); | var $contents = $('.player-tab-content'); | ||
var $lbox = $('.l-box'); | |||
if ($tabs.length === 0) return; | if ($tabs.length === 0) return; | ||
| Рядок 265: | Рядок 266: | ||
$contents.removeClass('active'); | $contents.removeClass('active'); | ||
$content.addClass('active'); | $content.addClass('active'); | ||
// Ховаємо/показуємо l-box залежно від табу | |||
if (tabId === 'games') { | |||
$lbox.fadeOut(200); | |||
} else { | |||
$lbox.fadeIn(200); | |||
} | |||
// Lazy load для ігор | // Lazy load для ігор | ||
| Рядок 271: | Рядок 279: | ||
if (playerName) { | if (playerName) { | ||
$.ajax({ | $.ajax({ | ||
url: mw.config.get('wgScriptPath') + '/api.php', | url: mw.config.get('wgScriptPath') + '/api.php', | ||
| Рядок 285: | Рядок 290: | ||
success: function(response) { | success: function(response) { | ||
if (response.expandtemplates && response.expandtemplates.wikitext) { | if (response.expandtemplates && response.expandtemplates.wikitext) { | ||
$.ajax({ | $.ajax({ | ||
url: mw.config.get('wgScriptPath') + '/api.php', | url: mw.config.get('wgScriptPath') + '/api.php', | ||
| Рядок 300: | Рядок 304: | ||
$content.html(parseResponse.parse.text['*']); | $content.html(parseResponse.parse.text['*']); | ||
$content.data('loaded', true); | $content.data('loaded', true); | ||
$content.find('table.sortable').tablesorter(); | $content.find('table.sortable').tablesorter(); | ||
} | } | ||