diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbrangeslider.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbrangeslider.directive.js index 9d9c6a3421..405641a9ab 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbrangeslider.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbrangeslider.directive.js @@ -322,20 +322,13 @@ For extra details about options and events take a look here: https://refreshless }); } function setUpActivePipsHandling() { - let activePip = [null, null]; sliderInstance.noUiSlider.on('update', function (values,handle) { - if(activePip[handle]){ - activePip[handle].classList.remove("noUi-value-active"); - } sliderInstance.querySelectorAll('.noUi-value').forEach(pip => { + pip.classList.remove("noUi-value-active"); if (Number(values[handle]) === Number(pip.getAttribute('data-value'))) { - activePip[handle] = pip; + pip.classList.add("noUi-value-active"); } }); - - if (activePip[handle]) { - activePip[handle].classList.add("noUi-value-active"); - } }); } function addPipClickHandler(){ diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js b/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js index a8bb36d3d5..4726a53aaf 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js @@ -54,20 +54,13 @@ angular.module("umbraco.install").controller("Umbraco.Install.UserController", f const pips = consentSlider.querySelectorAll('.noUi-value'); - let activePip = [null, null]; consentSlider.noUiSlider.on('update', function (values,handle) { - if(activePip[handle]){ - activePip[handle].classList.remove("noUi-value-active"); - } consentSlider.querySelectorAll('.noUi-value').forEach(pip => { + pip.classList.remove("noUi-value-active"); if (Number(values[handle]) === Number(pip.getAttribute('data-value'))) { - activePip[handle] = pip; + pip.classList.add("noUi-value-active"); } }); - - if (activePip[handle]) { - activePip[handle].classList.add("noUi-value-active"); - } }); $(consentSlider).on('$destroy', function () {