From 1f8fdb47b64a4158c35111440f598d4aab7bec52 Mon Sep 17 00:00:00 2001 From: "Foluso ADEBISI (DevBox Aux)" Date: Thu, 1 Oct 2026 04:39:08 +0100 Subject: [PATCH] =?UTF-8?q?refactor(cropper):=20drop=20the=20cropped=20pre?= =?UTF-8?q?view=20=E2=80=94=20the=20cleaned=20image=20is=20the=20only=20pr?= =?UTF-8?q?eview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The extra cropped-result panel duplicated what the crop pad already shows and the cleaned image supersedes it. Removes the panel, its state, the pointer- release refresh handlers and the app.js plumbing. The crop result is still uploaded (croppa stays the source when nothing is cleaned). --- tools/public/assets/cropper/app.js | 27 -------------------------- tools/public/assets/cropper/index.html | 8 +------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/tools/public/assets/cropper/app.js b/tools/public/assets/cropper/app.js index 3b21782..ab124e9 100644 --- a/tools/public/assets/cropper/app.js +++ b/tools/public/assets/cropper/app.js @@ -22,7 +22,6 @@ Vue.config.ignoredElements = [/^cds-/]; reviewed: false, accepted: false, cleanedImage: null, - cropPreview: '', requiresCleaning: '', otp: '', reviewOptions: [ @@ -109,30 +108,7 @@ Vue.config.ignoredElements = [/^cds-/]; this.toasts = this.toasts.filter(function (t) { return t.id !== id; }); }, - /** - * Current crop result — the operator should see what will be uploaded. - * croppa loads its source image asynchronously, so retry briefly until - * the canvas can produce a URL. - */ - refreshCropPreview: function (attempt) { - var self = this; - var tries = attempt || 0; - this.$nextTick(function () { - try { - var croppa = self.croppaInstance; - self.cropPreview = - croppa && croppa.generateDataUrl ? croppa.generateDataUrl('image/jpeg') || '' : ''; - } catch (error) { - self.cropPreview = ''; - } - if (!self.cropPreview && tries < 12) { - setTimeout(function () { self.refreshCropPreview(tries + 1); }, 200); - } - }); - }, - reset: function () { - this.cropPreview = ''; this.message = null; this.agent = null; this.process = null; @@ -173,8 +149,6 @@ Vue.config.ignoredElements = [/^cds-/]; } this.message.message.file_url = image.data.data; this.cleanedImage = null; - this.cropPreview = ''; - this.$nextTick(this.refreshCropPreview); // croppa needs the image first this.agent = null; this.process = this.message.message.process || null; if (this.message.message.upload_id) { @@ -212,7 +186,6 @@ Vue.config.ignoredElements = [/^cds-/]; var fr = new FileReader(); fr.onload = function () { self.cleanedImage = fr.result; }; fr.readAsDataURL(blob); - this.refreshCropPreview(); } catch ({ message }) { this.toast('error', 'Image Cleanup Failed', message); } finally { diff --git a/tools/public/assets/cropper/index.html b/tools/public/assets/cropper/index.html index c1635b0..52b71e9 100644 --- a/tools/public/assets/cropper/index.html +++ b/tools/public/assets/cropper/index.html @@ -80,17 +80,11 @@
-
+
-