Skip to content

Commit

Permalink
fix all same size btn
Browse files Browse the repository at this point in the history
  • Loading branch information
javl committed May 2, 2023
1 parent e3d82fb commit 65b3e44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ <h2>2. Image Settings</h2>
<ul id="image-size-settings"></ul>
<div id="only-images-file-error" class="msg error-msg">Only images file type are allowed</div>
<div id="no-file-selected" class="msg">No files selected</div>
<button id="all-same-size">all same size</button>
<button id="all-same-size">Apply first image size to all images</button>
</div>
</div>

Expand Down
3 changes: 2 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const settings = {
};

let outputString = '';
let allSameSizeButton;

function bitswap(b) {
if (settings.bitswap) {
Expand Down Expand Up @@ -711,7 +712,6 @@ function handleTextInput(drawMode) {
}

function allSameSize(_images, files) {
const allSameSizeButton = document.getElementById('all-same-size');
if (_images.length() > 1 && _images.length() === files.length) {
// multiple images settings container
// var imageSizeSettings = document.getElementById("image-size-settings");
Expand Down Expand Up @@ -1134,6 +1134,7 @@ window.onload = () => {
fileInput.addEventListener('click', () => { this.value = null; }, false);
fileInput.addEventListener('change', handleImageSelection, false);

allSameSizeButton = document.getElementById('all-same-size');
// The variable to hold our images. Global so we can easily reuse it when the
// user updates the settings (change canvas size, scale, invert, etc)

Expand Down

0 comments on commit 65b3e44

Please sign in to comment.