if (main_img === null || main_img.complete) {
img.src = url;
} else {
- main_img.addEventListener('load', function() { img.src = url; }, false);
+ main_img.addEventListener('load', function() { img.src = url; }, { 'once': true });
}
// Seemingly one needs to delay position_image(), or Firefox will set the initial
img.style.transform = "translate(" + extra_x_offset + "px,0px)";
if (box) {
- img.style.top = Math.min(top + height, screen_size[1] - 24) / dpr + "px";
+ img.style.top = Math.min(top + height, screen_size[1] - 24 * dpr) / dpr + "px";
img.style.height = "24px";
img.style.width = null;
img.style.whiteSpace = 'nowrap';