미디어위키:Common.js: 두 판 사이의 차이

편집 요약 없음
편집 요약 없음
226번째 줄: 226번째 줄:
         }
         }
     }
     }
    var totalWidth = $elem.clientWidth;


     if ($elem.children.length > 0) {
     if ($elem.children.length > 0) {
         for (var i = $elem.children.length - 1; i > 0; i--) {
         for (var i = $elem.children.length - 1; i >= 0; i--) {
             if (!$elem.children[i].classList.contains('albumitem')) {
             if (!$elem.children[i].classList.contains('albumitem')) {
                 $elem.children[i].remove();
                 $elem.children[i].remove();
260번째 줄: 262번째 줄:


             var ratio = $img.naturalWidth / $img.naturalHeight;
             var ratio = $img.naturalWidth / $img.naturalHeight;
             $elem.children[i].style.width = (ratio / totalRatio) * 100 + '%';
             $elem.children[i].style.width = (ratio / totalRatio) * (totalWidth - 6 * lineMax) + 6 + 'px';
         }
         }
     }
     }
}
}