MediaWiki:Gadget-MobileScript.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 22: Line 22:
}
}
}
}
});
/* Adjust margin of thumbs with no caption */
function thumbFixer() {
$('.thumb').each(function(i, obj) {
if (!$(this).find('.thumbcaption').text()) {
if (window.matchMedia('all and (max-width: 719px)').matches)
$(this).css('margin-bottom', '0.75em');
else
$(this).css('margin-bottom', '');
}
});
}
$(thumbFixer);
$(window).resize(function() {
$(thumbFixer);
});
});