• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
Support multiple .toggle elements
Line 1: Line 1:  
(function(mw, $) {
 
(function(mw, $) {
 +
 
     "use strict";
 
     "use strict";
 +
 
     $(document).ready(function() {
 
     $(document).ready(function() {
   Line 35: Line 37:  
                 toggleStorage.toggle();
 
                 toggleStorage.toggle();
 
             }
 
             }
 +
            var toggle_show_selector = '.toggle[data-target="' + property + '"] .toggle-show',
 +
                toggle_hide_selector = '.toggle[data-target="' + property + '"] .toggle-hide';
 
             if (toggleStorage.on()) {
 
             if (toggleStorage.on()) {
                 $(".toggle-show").show();
+
                 $(toggle_show_selector).show();
                 $(".toggle-hide").hide();
+
                 $(toggle_hide_selector).hide();
 
                 $(target_class).show();
 
                 $(target_class).show();
 
                 if (anti_target_class) {
 
                 if (anti_target_class) {
Line 43: Line 47:  
                 }
 
                 }
 
             } else {
 
             } else {
                 $(".toggle-show").hide();
+
                 $(toggle_show_selector).hide();
                 $(".toggle-hide").show();
+
                 $(toggle_hide_selector).show();
 
                 $(target_class).hide();
 
                 $(target_class).hide();
 
                 if (anti_target_class) {
 
                 if (anti_target_class) {
Line 69: Line 73:     
     });
 
     });
 +
 
}(mediaWiki, jQuery));
 
}(mediaWiki, jQuery));
cssedit, gkautomate
6,928

edits

Navigation menu