Difference between revisions of "MediaWiki:Common.js"

From RimWorld Wiki
Jump to navigation Jump to search
m (Undo revision 11299 by AcDie (talk))
m
Line 6: Line 6:
 
         $(this).toggleClass('opened').toggleClass('closed').next().slideToggle();
 
         $(this).toggleClass('opened').toggleClass('closed').next().slideToggle();
 
         if ($(this).hasClass('opened')) {
 
         if ($(this).hasClass('opened')) {
             $(this).html(' [hide] ');
+
             $(this).html('  ');
 
         } else {
 
         } else {
             $(this).html(' [show] ');
+
             $(this).html('  ');
 
         }
 
         }
 
     });
 
     });
 
});
 
});

Revision as of 13:17, 13 January 2014

/* Any JavaScript here will be loaded for all users on every page load. */

jQuery(document).ready(function ($) {
    $('.spoiler-body').hide();
    $('.spoiler-title').click(function () {
        $(this).toggleClass('opened').toggleClass('closed').next().slideToggle();
        if ($(this).hasClass('opened')) {
            $(this).html('  ');
        } else {
            $(this).html('  ');
        }
    });
});