MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 346: Line 346:
     });
     });


     $('.related-skills [data-type="table-row"]').each(function () {
     // $('.related-skills [data-type="table-row"]').each(function () {
        var cell = $(this).find('[data-type="table-cell"]');
    //    var cell = $(this).find('[data-type="table-cell"]');
        var count_in_row = cell.length / 2;
    //    var count_in_row = cell.length / 2;
        if (count_in_row > 4) {
    //    if (count_in_row > 4) {
            var overflow_elems = cell.slice(8, count_in_row * 2);
    //        var overflow_elems = cell.slice(8, count_in_row * 2);
            if ($(this).next().attr('data-type') != 'table-row') $(this).after('<div data-type="table-row">');
    //        if ($(this).next().attr('data-type') != 'table-row') $(this).after('<div data-type="table-row">');
            $(this).next().append(overflow_elems);
    //        $(this).next().append(overflow_elems);
        }
    //    }
     });
     // });


     $('.related-skills:not(.no-div)').addClass('shown');
     $('.related-skills:not(.no-div)').addClass('shown');