summaryrefslogtreecommitdiff
path: root/extensions/Vector/modules/jquery.footerCollapsibleList.js
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Vector/modules/jquery.footerCollapsibleList.js')
-rw-r--r--extensions/Vector/modules/jquery.footerCollapsibleList.js44
1 files changed, 0 insertions, 44 deletions
diff --git a/extensions/Vector/modules/jquery.footerCollapsibleList.js b/extensions/Vector/modules/jquery.footerCollapsibleList.js
deleted file mode 100644
index 7b9b5bcb..00000000
--- a/extensions/Vector/modules/jquery.footerCollapsibleList.js
+++ /dev/null
@@ -1,44 +0,0 @@
-( function( $ ) {
- // Small jQuery plugin to handle the toggle function & cookie for state
- // For collapsible items in the footer
- $.fn.footerCollapsibleList = function( config ) {
- if ( !( 'title' in config ) || !( 'name' in config ) ) {
- return;
- }
-
- return this.each( function () {
- var $container, $ul, $explanation, $icon;
-
- $container = $( this );
- $ul = $container.find( 'ul' );
- $explanation = $container.find( '.mw-templatesUsedExplanation, .mw-hiddenCategoriesExplanation' );
-
- $icon = $( '<span>' );
- $ul.before(
- $( '<a>' )
- .addClass( 'collapsible-list' )
- .text( config.title )
- .append( $icon )
- .on( 'click', function( e ) {
- // Modify state cookie.
- var state = ( $.cookie( config.name ) !== 'expanded' ) ? 'expanded' : 'collapsed';
- $.cookie( config.name, state );
-
- // Modify DOM.
- $ul.slideToggle();
- $icon.toggleClass( 'collapsed' );
-
- e.preventDefault();
- } )
- );
-
- $explanation.remove();
-
- // Check cookie and collapse.
- if( $.cookie( config.name ) === null || $.cookie( config.name ) === 'collapsed' ) {
- $ul.hide();
- $icon.addClass( 'collapsed' );
- }
- } );
- };
-}( jQuery ) );