From ec26e5eabf9e25795a3627fd34bdfb61442dfb39 Mon Sep 17 00:00:00 2001 From: Ethan Nagano Date: Thu, 1 Feb 2024 21:54:13 -0800 Subject: [PATCH] Update nouislider options for image cropper. Previous slider min and max values caused home and end keys to behave incorrectly. Min is now 0 to reflect 0% zoom and max is now 100 to reflect max zoom. Additionally, adjusted step to 0.01 to avoid slow adjustments when using arrow keys or page up / page down keys. Issue: #15578 --- .../components/imaging/umbimagecrop.directive.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/imaging/umbimagecrop.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/imaging/umbimagecrop.directive.js index 1f5d506bdd..cba21d2eb5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/imaging/umbimagecrop.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/imaging/umbimagecrop.directive.js @@ -50,19 +50,11 @@ angular.module("umbraco.directives") scope.sliderOptions = { "start": scope.dimensions.scale.current, - "step": 0.001, + "step": 0.01, "tooltips": [false], - "format": { - to: function (value) { - return parseFloat(parseFloat(value).toFixed(3)); - }, - from: function (value) { - return parseFloat(parseFloat(value).toFixed(3)); - } - }, "range": { - "min": scope.dimensions.scale.min, - "max": scope.dimensions.scale.max + "min": 0, + "max": 100 } };