This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Hi this is not needed any more there is an extension at https://www.mediawiki.orghttps://wikifreehand.com/en/Extension:CollapsibleVector that does this now. 86.132.31.17 (talk) 14:43, 2 November 2014 (UTC)
-- ] {{talk}}
16:12, 2 November 2014 (UTC)This edit request to MediaWiki:Gadget-CollapsibleNav.css has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
The collapsible SVG indicators were moved to /w/resources/src/mediawiki.icon/images/arrow-expanded-ltr.svg
and /w/resources/src/mediawiki.icon/images/arrow-collapsed-ltr.svg
. --Izno (talk) 16:17, 4 October 2020 (UTC)
/w/resources/src/mediawiki.icon/images/arrow-expanded.svg?d0685
and /w/resources/src/mediawiki.icon/images/arrow-collapsed-ltr.svg?40e9a
. I'm not sure why query strings are necessary but I'm not going to test further on the point. --Izno (talk) 21:41, 5 October 2020 (UTC)
Done, but it still doesn't seem to be working :( — Martin (MSGJ · talk) 12:49, 9 October 2020 (UTC)
It probably requires to be updated (doesn't collapse sections, at least for me), most likely with css (the current style used by sections, .vector-menu-portal h3: background-size: 100% 1px;, turns the collapse arrow into a line) using the working source code from the mw:Extension:CollapsibleVector (same base code)?
Village pump discussion MarMi wiki (talk) 13:26, 24 November 2021 (UTC)
This edit request to MediaWiki:Gadget-CollapsibleNav.js and MediaWiki:Gadget-CollapsibleNav.css has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
// CC0
'use strict';
function onToggle( e ) {
var collapsedIds = mw.storage.getObject( 'vector-nav-collapsed' ) || ,
index = collapsedIds.indexOf( this.id );
if ( e.type === 'afterExpand' ) {
// Remove ID from array
if ( index !== -1 ) {
collapsedIds.splice( index, 1 );
}
if ( collapsedIds.length ) {
mw.storage.setObject( 'vector-nav-collapsed', collapsedIds );
} else {
// Remove the data altogether if empty
mw.storage.remove( 'vector-nav-collapsed' );
}
} else {
if ( index === -1 ) {
collapsedIds.push( this.id );
mw.storage.setObject( 'vector-nav-collapsed', collapsedIds );
}
}
}
$( function () {
var collapsedIds = mw.storage.getObject( 'vector-nav-collapsed' ) || ;
$( '#mw-panel .vector-menu' )
.addClass( 'collapsible-nav mw-collapsible' )
.addClass( function () {
if ( collapsedIds.indexOf( this.id ) !== -1 ) {
return 'mw-collapsed';
}
} )
.children( '.vector-menu-heading' )
.addClass( 'mw-collapsible-toggle' )
.end()
.children( '.vector-menu-content' )
.addClass( 'mw-collapsible-content' )
.end()
.makeCollapsible()
.on( 'afterCollapse.mw-collapsible afterExpand.mw-collapsible', onToggle );
} );
.collapsible-nav > .mw-collapsible-toggle {
float: none;
cursor: pointer;
}
.collapsible-nav > .mw-collapsible-toggle::before {
display: inline-block;
width: 12px;
content: url(/w/resources/src/mediawiki.icon/images/arrow-expanded.svg?d0685);
}
.collapsible-nav > .mw-collapsible-toggle-collapsed::before {
content: url(/w/resources/src/mediawiki.icon/images/arrow-collapsed-ltr.svg?40e9a);
}
This edit request to MediaWiki:Gadgets-definition has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Additional dependencies are jquery.makeCollapsible
and mediawiki.storage
. You may test it as a user script by running
mw.loader.load( '//test.wikipedia.org/w/index.php?title=User:Nardog/CollapsibleNav.js&action=raw&ctype=text/javascript' );
I don't know if this faithfully recreates the previous behavior but I bet it's close looking at the code. Nardog (talk) 14:50, 24 November 2021 (UTC)
* CollapsibleNav|CollapsibleNav.js|CollapsibleNav.css
jquery.cookie
is no longer used so just * CollapsibleNav|CollapsibleNav.js|CollapsibleNav.css
will do. Nardog (talk) 16:52, 10 December 2021 (UTC)