Bug 790294 - GCLI screenshot command should show preview., r=jwalker

This commit is contained in:
Girish Sharma 2012-09-14 02:33:37 +05:30
Родитель 21a133dd35
Коммит 47fcea7f64
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -220,6 +220,14 @@ gcli.addCommand({
file.reveal(); file.reveal();
}); });
div.style.cursor = "pointer"; div.style.cursor = "pointer";
let image = document.createElement("div");
let previewHeight = parseInt(256*height/width);
image.setAttribute("style",
"width:256px; height:" + previewHeight + "px;" +
"background-image: url('" + data + "');" +
"background-size: 256px " + previewHeight + "px;" +
"margin: 4px; display: block");
div.appendChild(image);
return div; return div;
} }
}); });