MediaWiki:Common.js

From Project: Gorgon Wiki
Revision as of 11:32, 23 September 2014 by Gorgonzola (talk | contribs) (Adding code for the Spoiler template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
/* Any JavaScript here will be loaded for all users on every page load. */

// Gorgonzola: See my comments in page discussion (trying to minimize page bloat here).

$('.spoilers-button').toggle(function() {
  $(this).parents('.spoilers').find('.spoilers-body').show();
  $(this).children('.spoilers-show').hide();
  $(this).children('.spoilers-hide').show();
}, function() {
  $(this).parents('.spoilers').find('.spoilers-body').hide();
  $(this).children('.spoilers-show').show();
  $(this).children('.spoilers-hide').hide();
});