MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 7: | Line 7: | ||
if (!$sidebar.length) return; | if (!$sidebar.length) return; | ||
// 1. Identifica e esconde as subpáginas | // 1. Identifica e esconde as subpáginas | ||
$sidebar.find('li').each(function() { | $sidebar.find('li').each(function() { | ||
var $li = $(this); | var $li = $(this); | ||
| Line 14: | Line 14: | ||
|| $li.text().includes('Release Notes'); | || $li.text().includes('Release Notes'); | ||
if (hasSubpage && !$li.text().includes('SENSBLUE ATLAS')) { | if (hasSubpage && !$li.text().includes('SENSBLUE ATLAS')) { | ||
$li.addClass('atlas-submenu'); | $li.addClass('atlas-submenu'); | ||
| Line 20: | Line 19: | ||
}); | }); | ||
// 2. Procura o item pai (SENSBLUE ATLAS) | // 2. Procura o item pai (SENSBLUE ATLAS) | ||
var $mainAtlasLi = $sidebar.find('li').filter(function() { | var $mainAtlasLi = $sidebar.find('li').filter(function() { | ||
var text = $(this).clone().children().remove().end().text().trim() || $(this).text().trim(); | var text = $(this).clone().children().remove().end().text().trim() || $(this).text().trim(); | ||
| Line 32: | Line 31: | ||
'display': 'flex', | 'display': 'flex', | ||
'align-items': 'center', | 'align-items': 'center', | ||
'justify-content': ' | 'justify-content': 'flex-start' // Move tudo para a esquerda juntinho | ||
}); | }); | ||
// 3. Cria a seta | // 3. Cria a seta colada ao texto | ||
var $toggleBtn = $('<span class="atlas-toggle-btn" style="cursor:pointer; margin-left:8px; user-select:none; font-weight:bold;">▶</span>'); | var $toggleBtn = $('<span class="atlas-toggle-btn" style="cursor:pointer; margin-left:8px; user-select:none; font-weight:bold;">▶</span>'); | ||
$mainAtlasLi.append($toggleBtn); | $mainAtlasLi.append($toggleBtn); | ||
// 4. Evento do clique | // 4. Evento do clique | ||