MediaWiki:Mobile.js: Difference between revisions

Provided by Tiddlywinks: Allow a single ClickToggle button to have multiple targets
(ClickToggle copied from de:MediaWiki:Common.js with permission. Script written by de:User:Buoysel. The documentation I adapted from PokéWiki with the help of Google Translate.)
(Provided by Tiddlywinks: Allow a single ClickToggle button to have multiple targets)
 
Line 43: Line 43:
             $(document).find('.clicktoggle-target').each( function () {
             $(document).find('.clicktoggle-target').each( function () {
                 var group2 = $(this).data('group');
                 var group2 = $(this).data('group');
                 var target2 = $(this).data('target');
                 var target2Arr = $(this).data('target').split(',');
                 if (group == group2) {
                 if (group == group2) {
                     if (type == 'toggle') {
                     if (type == 'toggle') {
                         if (target == target2) {
                         if (jQuery.inArray( target, target2Arr ) !== -1) {
                             if ($(this).css('display') == 'none')
                             if ($(this).css('display') == 'none')
                                 $(this).css('display', '');
                                 $(this).css('display', '');
Line 58: Line 58:
                         }
                         }
                     } else if (type == 'set') {
                     } else if (type == 'set') {
                         if (target == target2) {
                         if (jQuery.inArray( target, target2Arr ) !== -1) {
                             $(this).css('display', '');
                             $(this).css('display', '');
                         } else {
                         } else {