From fe156a38d33efbb4b86430c96324ba5c7c6d402d Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 22 Jan 2023 17:58:23 +0100 Subject: [PATCH] Appease the dog overlords --- .../retrospring/controllers/cropper_controller.ts | 6 +++--- app/views/settings/profile/edit.html.haml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/javascript/retrospring/controllers/cropper_controller.ts b/app/javascript/retrospring/controllers/cropper_controller.ts index 269d0066..921e328c 100644 --- a/app/javascript/retrospring/controllers/cropper_controller.ts +++ b/app/javascript/retrospring/controllers/cropper_controller.ts @@ -18,18 +18,18 @@ export default class extends Controller { declare readonly aspectRatioValue: string; - readImage(file, callback) { + readImage(file: File, callback: (string) => void): void { callback((window.URL || window.webkitURL).createObjectURL(file)); } - updateValues(data) { + updateValues(data: Record): void { this.xTarget.value = data.x; this.yTarget.value = data.y; this.wTarget.value = data.width; this.hTarget.value = data.height; } - change() { + change(): void { this.controlsTarget.classList.toggle('d-none'); if (this.inputTarget.files && this.inputTarget.files[0]) { diff --git a/app/views/settings/profile/edit.html.haml b/app/views/settings/profile/edit.html.haml index ad75dd65..32721590 100644 --- a/app/views/settings/profile/edit.html.haml +++ b/app/views/settings/profile/edit.html.haml @@ -2,7 +2,7 @@ .card-body = bootstrap_form_for(current_user, url: settings_profile_picture_path, html: { multipart: true }, method: :patch, data: { turbo: false }) do |f| - %div{ data: { controller: "cropper", cropper_aspect_ratio_value: "1"}} + %div{ data: { controller: "cropper", cropper_aspect_ratio_value: "1" } } .d-flex .flex-shrink-0 %img.avatar-lg.me-3{ src: current_user.profile_picture.url(:medium) } @@ -17,7 +17,7 @@ - %i[profile_picture_x profile_picture_y profile_picture_w profile_picture_h].each do |attrib| = f.hidden_field attrib, id: attrib, data: { cropper_target: attrib.to_s.split("_").last } - %div{ data: { controller: "cropper", cropper_aspect_ratio_value: "0.23"}} + %div{ data: { controller: "cropper", cropper_aspect_ratio_value: "0.23" } } .row.mb-2 .col-xs-12.col-md-6 %img.mw-100.me-3{ src: current_user.profile_header.url(:mobile) }