MediaWiki:Gadget-GlobalScript.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 21: Line 21:
var onlyVideos = videos.length == boxes.length ? true : false;
var onlyVideos = videos.length == boxes.length ? true : false;
videos.each(function(ii, video) {
videos.each(function(ii, video) {
if (!onlyVideos)
if (onlyVideos)
$(video).css('max-height', 0);
$(video).css('height', 'auto');
$(video).parent().css({'width': '100%', 'min-width': '125px', 'max-width': 'calc(100% - 30px)', 'margin': 'auto'});
$(video).parent().css('max-width', 'calc(100% - 30px)');
});
});
var timeOut = onlyVideos ? 500 : 0;
var timeOut = onlyVideos ? 1000 : 0;
setTimeout(function() {
setTimeout(function() {
var height = 0;
var height = 0;
Line 34: Line 34:
videos.each(function(ii, video) {
videos.each(function(ii, video) {
maxHeight = height - 30;
maxHeight = height - 30;
$(video).css('max-height', maxHeight);
$(video).parent().parent().css({'height': height, 'display': 'flex'});
$(video).parent().parent().css({'height': height, 'display': 'flex'});
$(video).parent().css({'width': '100%', 'min-width': '125px', 'margin': 'auto'});
$(video).css({'height': 'auto', 'max-height': maxHeight});
});
});
}, timeOut);
}, timeOut);