MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary Tag: Manual revert |
No edit summary |
||
| Line 31: | Line 31: | ||
'display': 'flex', | 'display': 'flex', | ||
'align-items': 'center', | 'align-items': 'center', | ||
'justify-content': 'flex-start' | 'justify-content': 'flex-start' | ||
}); | }); | ||
// 3. Cria | $mainAtlasLi.find('a, .mw-selflink, span').css({ | ||
var $toggleBtn = $('<span class="atlas-toggle-btn" style="cursor:pointer; margin- | 'display': 'inline', | ||
$mainAtlasLi. | 'width': 'auto' | ||
}); | |||
// 3. Cria o chevron inicial fechado (›) | |||
var $toggleBtn = $('<span class="atlas-toggle-btn" style="cursor:pointer; margin-right:8px; user-select:none; font-weight:bold; font-size:1.1em; color:#54595d;">›</span>'); | |||
// Injeta à esquerda | |||
$mainAtlasLi.prepend($toggleBtn); | |||
// 4. Evento do clique | // 4. Evento do clique | ||
| Line 45: | Line 52: | ||
$('.atlas-submenu').toggleClass('is-open'); | $('.atlas-submenu').toggleClass('is-open'); | ||
if ($(this).text() === ' | // Alterna entre o chevron para a direita (›) e para baixo (˅) | ||
$(this).text(' | if ($(this).text() === '›') { | ||
$(this).text('˅'); // Igual ao formato de image_4a7113.png | |||
} else { | } else { | ||
$(this).text(' | $(this).text('›'); | ||
} | } | ||
}); | }); | ||