MediaWiki:Gadget-MobileScript.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 14: Line 14:
if ($('.navbox-section').length) {
if ($('.navbox-section').length) {
if ($('section:nth-last-of-type(2) > *:not(.navbox):not(.mw-empty-elt)').length > 0
if ($('section:nth-last-of-type(2) > *:not(.navbox):not(.mw-empty-elt)').length > 0
    || $('.section-heading:nth-last-of-type(2) > .mw-headline#References').length > 0
  || $('.section-heading:nth-last-of-type(2) > .mw-headline#References').length > 0
    || $('.section-heading:nth-last-of-type(2) > .mw-headline#Sources').length > 0)
  || $('.section-heading:nth-last-of-type(2) > .mw-headline#Sources').length > 0)
$('section:nth-last-of-type(2) > .navbox').detach().appendTo('.navbox-section');
$('section:nth-last-of-type(2) > .navbox').detach().appendTo('.navbox-section');
if ($.trim($('.navbox-section').text()) == '') {
if ($.trim($('.navbox-section').text()) == '') {