78d5bd03 by Jeff Balicki

3

1 parent eebb4620
......@@ -233,24 +233,26 @@ function changePdfOptions(json, edit) {
var windowHeight = 0.86 * $(window).height();
var windowHBG = 0.923 * $(window).height();
var pwidth = parseInt(json[0].pwidth);
var pheight = parseInt(json[0].pheight);
if(json[0].pwidth > json[0].pheight){
console.log('wide')
var scaleImage = windowWidth / json[0].pwidth;
var imageHeight = json[0].pheight * scaleImage;
if(pwidth > pheight){
//console.log('wide')
var scaleImage = windowWidth / pwidth;
var imageHeight = pheight * scaleImage;
var imageWidth = windowWidth;
var imgLeft = 0;
var imgTop = 25;
}else{
var scaleImage = windowHeight / json[0].pheight;
var scaleImage = windowHeight / pheight;
var imageHeight = windowHeight;
var imageWidth = json[0].pwidth * scaleImage;
var imageWidth = pwidth * scaleImage;
var imgLeft = 30;
var imgTop = 2;
}
console.log('windowWidth'+windowWidth ,'windowHeight'+windowHeight,'pheight'+json[0].pheight,'pwidth'+json[0].pwidth,'imageWidth'+imageWidth, 'imageHeight'+imageHeight);
// console.log('windowWidth'+windowWidth ,'windowHeight'+windowHeight,'pheight'+json[0].pheight,'pwidth'+json[0].pwidth,'imageWidth'+imageWidth, 'imageHeight'+imageHeight);
pdflist += '<div id="pdfPreview" style="" class="column">';
// pdflist += '<img id="pdfimage" src="' + pdf_customizer + '/fileentry/getImage/' + json[0].folder + '/' + json[0].example + '" width="300px">';
......@@ -502,17 +504,20 @@ function returnOptions(form) {
var windowHeight = 0.86 * $(window).height();
var windowHBG = 0.923 * $(window).height();
var pwidth = parseInt(json[0].pwidth);
var pheight = parseInt(json[0].pheight);
if(json[0].pwidth > json[0].pheight){
var scaleImage = windowWidth / json[0].pwidth;
var imageHeight = json[0].pheight * scaleImage;
if(pwidth > pheight){
var scaleImage = windowWidth / pwidth;
var imageHeight = pheight * scaleImage;
var imageWidth = windowWidth;
var imgLeft = 0;
var imgTop = 25;
}else{
var scaleImage = windowHeight / json[0].pheight;
var scaleImage = windowHeight / pheight;
var imageHeight = windowHeight;
var imageWidth = json[0].pwidth * scaleImage;
var imageWidth = pwidth * scaleImage;
var imgLeft = 30;
var imgTop = 2;
}
......