Difference between revisions of "MediaWiki:Common.js"
From Mashinky
(Created page with "→Any JavaScript here will be loaded for all users on every page load.: jQuery( function ( $ ) { $( 'table.transformable' ).each( function () { blnHaveHeadRow = f...") |
(No difference)
|
Latest revision as of 21:23, 22 October 2017
/* Any JavaScript here will be loaded for all users on every page load. */ jQuery( function ( $ ) { $( 'table.transformable' ).each( function () { blnHaveHeadRow = false; var firstRowCells = $( this ).find('tr:first').find("th"); if(firstRowCells.length>0){ blnHaveHeadRow = true; } if(blnHaveHeadRow){ $( this ).find('tr').each( function () { var i = 0; $( this ).find('td').each( function () { $( this ).html("<span>"+$( firstRowCells ).eq(i).html()+"</span>" + $( this ).html()); i++; } ); } ); } } ); } );