84ba187e by Jeff Balicki

dd

1 parent 81b6cc05
......@@ -194,6 +194,7 @@
function changePdfOptions(json) {
jQuery(function($) {
json = JSON.parse(json);
......@@ -204,7 +205,7 @@
var pdflist = "";
var pdfChange = "";
var f = 0;
console.log(json[0].pheight ,json[0].pwidth);
if(json[0].pwidth > 300){
var scaleImage = 300 / json[0].pwidth;
var imageHeight = json[0].pheight * scaleImage;
......@@ -242,16 +243,56 @@
strVar2 += ' <div class="callout primary"><div class="row column"><h1>Welcome to Synapsus Online PDF Editor</h1>';
strVar2 += '<p class="lead">Please make your changes or return <a href="#" onclick="location.reload();">back to the list</a></p>';
strVar2 += ' </div></div><div id="wrapper" class="row small-up-2 medium-up-3 large-up-3">';
strVar2 += pdflist + '<div id="changesColumn" class="column" >' + pdfChange + '</div><div id="pdfFooter"></div></div>';
strVar2 += pdflist + '<div id="changesColumn" style="height:'+$("#changes").height()+';" class="column" >' + pdfChange + '</div><div id="pdfFooter"></div></div>';
document.getElementById('contentArea').innerHTML = strVar2;
document.getElementById('google_drive').innerHTML = " ";
jQuery(function($) {
console.log($("#pdfPreview").height() ,$("#changes").height());
if($("#pdfPreview").height() > $("#changes").height()){
$('#changesColumn').css('position' ,'relative');
var stickySidebar = $('#changesColumn');
if (stickySidebar.length > 0) {
var stickyHeight = stickySidebar.height(),
sidebarTop = stickySidebar.offset().top;
}
// on scroll move the sidebar
$(window).scroll(function () {
if (stickySidebar.length > 0) {
var scrollTop = $(window).scrollTop();
if (sidebarTop < scrollTop) {
stickySidebar.css('top', scrollTop - sidebarTop);
// stop the sticky sidebar at the footer to avoid overlapping
var sidebarBottom = stickySidebar.offset().top + stickyHeight,
stickyStop = $('#pdfPreview').offset().top + $('#pdfPreview').height();
if (stickyStop < sidebarBottom) {
var stopPosition = $('#pdfPreview').height() - stickyHeight;
stickySidebar.css('top', stopPosition);
}
}
else {
stickySidebar.css('top', '0');
}
}
});
$(window).resize(function () {
if (stickySidebar.length > 0) {
stickyHeight = stickySidebar.height();
}
});
}else{
console.log('false');
var stickySidebar = $('#pdfPreview');
if (stickySidebar.length > 0) {
......@@ -286,6 +327,11 @@ $(window).resize(function () {
stickyHeight = stickySidebar.height();
}
});
}
......