Skip to content

Commit 9155991

Browse files
committed
Integrate the reset button
1 parent 6b82e85 commit 9155991

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

js/cloudinary.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/components/crops-sizes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ const CropSizes = {
105105
} );
106106
disable.bound = true;
107107
}
108+
109+
// Bind reset button
110+
const resetButton = sizeContent.querySelector( '.clear-crop-input' );
111+
if ( resetButton && ! resetButton.bound ) {
112+
resetButton.addEventListener( 'click', () => {
113+
input.value = '';
114+
this.buildImages( wrapper, sizeContent );
115+
} );
116+
resetButton.bound = true;
117+
}
108118
},
109119
};
110120

0 commit comments

Comments
 (0)