How to use the cropperjs.default function in cropperjs

To help you get started, we’ve selected a few cropperjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paperbits / paperbits-core / src / workshops / cropper / cropper.ts View on Github external
init: (imageElement: HTMLImageElement, valueAccessor) => {
                const observable = valueAccessor();
                const cropperInstance = new Cropper.default(imageElement, {
                    // aspectRatio: 1,
                    viewMode: 1,
                    responsive: true,
                    ready: () => {
                        this["croppable"] = true;
                    }
                });

                observable(cropperInstance);

                const onResize = () => {
                    cropperInstance["resize"]();
                };

                eventManager.addEventListener("onEditorResize", onResize);

cropperjs

JavaScript image cropper.

MIT
Latest version published 8 months ago

Package Health Score

88 / 100
Full package analysis