MediaWiki:Mobile.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Tag: Reverted
Line 5: Line 5:
     console.log('Initializing simple mobile sorting...');
     console.log('Initializing simple mobile sorting...');
      
      
     // Check if we're on mobile (Minerva skin or small screen)
     // Apply custom table sorting on both mobile and desktop
     var isMobile = (typeof mw !== 'undefined' && mw.config && mw.config.get('skin') === 'minerva') ||
     console.log('Applying custom table sorting for all devices');
                  window.matchMedia("(max-width: 768px)").matches;
      
      
     if (isMobile) {
     var tables = document.querySelectorAll('.wikitable, table.sortable');
        console.log('Mobile detected, applying custom table sorting');
    console.log('Found tables:', tables.length);
       
   
        var tables = document.querySelectorAll('.wikitable, table.sortable');
    $(tables).each(function(index, table) {
        console.log('Found tables:', tables.length);
        setupTableSorting($(table), index);
       
    });
        $(tables).each(function(index, table) {
            setupTableSorting($(table), index);
        });
    }
}
}