diff --git a/public/css/app.css b/public/css/app.css index 8de4c50..731bba8 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -34,17 +34,18 @@ max-height: 200px; } -.canvas-container .btn-drag, .canvas-container .btn-rotate { +.canvas-container .btn-drag, .canvas-container .btn-rotate, .canvas-container .btn-delete, .canvas-container .btn-select, .canvas-container .btn-download { font-size: 30px; cursor: move; background: rgb(255,255,255,0.6); opacity: 0; } -.canvas-container .btn-rotate { +.canvas-container .btn-rotate, .canvas-container .btn-delete, .canvas-container .btn-select, .canvas-container .btn-download { cursor: pointer; + font-size: 25px; } -.canvas-container:hover .btn-drag, .canvas-container:hover .btn-rotate { +.canvas-container:hover .btn-drag, .canvas-container:hover .btn-rotate, .canvas-container:hover .btn-delete, .canvas-container:hover .btn-select, .canvas-container:hover .btn-download { opacity: 1; } diff --git a/public/js/organization.js b/public/js/organization.js index 5494364..b60a3e2 100644 --- a/public/js/organization.js +++ b/public/js/organization.js @@ -34,7 +34,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) { @@ -67,19 +67,10 @@ var loadPDF = async function(pdfBlob, filename, pdfIndex) { return false; }); - - canvasContainer.querySelector('input[type=checkbox]').addEventListener('click', function(e) { - e.stopPropagation(); - }); - canvasContainer.querySelector('input[type=checkbox]').addEventListener('change', function(e) { - stateCheckbox(this); - stateCheckboxAll(); - }); - canvasContainer.querySelector('.container-checkbox').addEventListener('click', function(e) { - let checkbox = this.querySelector('input[type=checkbox]'); + canvasContainer.querySelector('.btn-delete').addEventListener('click', function(e) { + let checkbox = this.parentNode.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked; stateCheckbox(checkbox); - stateCheckboxAll(); }); canvasContainer.querySelector('.btn-rotate').addEventListener('click', function(e) { let inputRotate = document.querySelector('#input_rotate_'+pageIndex); @@ -135,24 +126,12 @@ var stateCheckbox = function(checkbox) { let checkboxContainer = checkbox.parentNode.parentNode.parentNode; if(checkbox.checked) { - 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)'; + checkboxContainer.style.opacity = '1' } 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'; + checkboxContainer.style.opacity = '0.2'; } }; -var stateCheckboxAll = function() { - document.querySelector('#checkbox_all_pages').checked = (document.querySelectorAll('.checkbox-page:checked').length == document.querySelectorAll('.checkbox-page').length); -}; - var updateListePDF = function() { document.querySelector('#list_pdf').innerHTML = ""; for (var i = 0; i < document.querySelector('#input_pdf').files.length; i++) { @@ -162,13 +141,6 @@ var updateListePDF = function() { } var createEventsListener = function() { - document.querySelector('#checkbox_all_pages').addEventListener('change', function() { - let checkboxAll = this; - document.querySelectorAll('.checkbox-page').forEach(function(checkbox) { - checkbox.checked = checkboxAll.checked; - stateCheckbox(checkbox); - }); - }); document.getElementById('save').addEventListener('click', function(event) { let order = []; document.querySelectorAll('.canvas-container').forEach(function(canvasContainer) { diff --git a/templates/organization.html.php b/templates/organization.html.php index 856393a..062b830 100644 --- a/templates/organization.html.php +++ b/templates/organization.html.php @@ -56,10 +56,6 @@ -
- - -