diff --git a/public/js/organization.js b/public/js/organization.js index 47310a0..4be42df 100644 --- a/public/js/organization.js +++ b/public/js/organization.js @@ -33,7 +33,7 @@ var loadPDF = async function(pdfBlob, filename, pdfIndex) { let pageIndex = pdfLetter + "_" + (page.pageNumber - 1); pages[pageIndex] = page; - document.getElementById('container-pages').insertAdjacentHTML('beforeend', '

Page '+page.pageNumber+' - '+filename+'

'); + document.getElementById('container-pages').insertAdjacentHTML('beforeend', '

Page '+page.pageNumber+' - '+filename+'

'); let canvasContainer = document.getElementById('canvas-container-' + pageIndex); canvasContainer.addEventListener('dragstart', function(e) { @@ -104,7 +104,7 @@ var pageRender = function(pageIndex) { let page = pages[pageIndex]; let rotation = parseInt(document.querySelector('#input_rotate_'+pageIndex).value); let viewport = page.getViewport({scale: 1, rotation: rotation}); - let size = (document.getElementById('container-pages').offsetWidth - (12*nbPagePerLine) - 12) / nbPagePerLine; + let size = Math.floor((document.getElementById('container-pages').offsetWidth - (8*(nbPagePerLine+1)) - 12) / nbPagePerLine); let scaleWidth = size / viewport.width; let scaleHeight = size / viewport.height; let viewportWidth = page.getViewport({scale: scaleWidth, rotation: rotation}); @@ -137,11 +137,13 @@ var stateCheckbox = function(checkbox) { checkboxContainer.querySelector('.canvas-pdf').style.opacity = '1'; checkboxContainer.querySelector('.canvas-pdf').style.cursor = 'inherit'; checkboxContainer.querySelector('.container-resize').classList.remove('d-none'); + checkboxContainer.querySelector('.container-rotate').classList.remove('d-none'); checkboxContainer.querySelector('.container-checkbox').style.background = 'rgb(255,255,255,0.8)'; } else { checkboxContainer.querySelector('.canvas-pdf').style.opacity = '0.3'; checkboxContainer.querySelector('.canvas-pdf').style.cursor = 'pointer'; checkboxContainer.querySelector('.container-resize').classList.add('d-none'); + checkboxContainer.querySelector('.container-rotate').classList.add('d-none'); checkboxContainer.querySelector('.container-checkbox').style.background = 'transparent'; } };