From 881df4546bc3ceb7a8a0290c4c91838659b64b70 Mon Sep 17 00:00:00 2001 From: Joost Luijben Date: Tue, 8 Nov 2022 01:34:35 +0100 Subject: [PATCH] Removed some lines and change the way of export --- src/nouislider.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/nouislider.js b/src/nouislider.js index 1ce99a26..0d6a2cfe 100644 --- a/src/nouislider.js +++ b/src/nouislider.js @@ -1,6 +1,6 @@ import noUiSlider from "nouislider"; -function init(Survey) { +export function init(Survey) { const iconId = "icon-nouislider"; Survey.SvgRegistry && Survey.SvgRegistry.registerIconFromSvg(iconId, require('svg-inline-loader?classPrefix!./images/nouislider.svg'), ""); var widget = { @@ -123,8 +123,6 @@ function init(Survey) { }); question.updateSliderProperties = function () { const elems = document.getElementsByClassName("noUi-pips"); - if (elems.length > 0) elems[elems.length - 1].style.display = "none"; - if (elems.length > 1) elems[elems.length - 2].style.display = "none"; var getStart = function(currentStart) { return question.rangeMin + Math.round((currentStart - question.rangeMin) / question.step) * question.step; } @@ -226,10 +224,4 @@ function init(Survey) { }, }; Survey.CustomWidgetCollection.Instance.addCustomWidget(widget, "customtype"); -} - -if (typeof Survey !== "undefined") { - init(Survey); -} - -export default init; +} \ No newline at end of file