Diferencia entre revisiones de «MediaWiki:Common.js»
Apariencia
Sin resumen de edición |
Sin resumen de edición |
||
Línea 1: | Línea 1: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
// | // Agregar botón de ocultar/mostrar | ||
$('.mw-portlet h3').append(' <span class="toggle-sidebar">(ocultar)</span>'); | $('.mw-portlet h3:contains("Contenidos")').append(' <span class="toggle-sidebar">(ocultar)</span>'); | ||
$('.toggle-sidebar').click(function() { | $('.toggle-sidebar').click(function() { | ||
$(this).parent().next('div' | var sidebarContent = $(this).parent().next('div'); | ||
sidebarContent.toggle(); | |||
$(this).text(sidebarContent.is(':visible') ? '(ocultar)' : '(mostrar)'); | |||
}); | }); | ||
}); | }); |
Revisión del 01:32 6 mar 2025
$(document).ready(function() { // Agregar botón de ocultar/mostrar $('.mw-portlet h3:contains("Contenidos")').append(' <span class="toggle-sidebar">(ocultar)</span>'); $('.toggle-sidebar').click(function() { var sidebarContent = $(this).parent().next('div'); sidebarContent.toggle(); $(this).text(sidebarContent.is(':visible') ? '(ocultar)' : '(mostrar)'); }); });