From 49144ea2dd9cd1e50f2b5933fefef49cd14e715f Mon Sep 17 00:00:00 2001 From: rdrew Date: Wed, 15 Apr 2026 15:52:38 -0300 Subject: [PATCH] search display --- js/custom.js | 62 ++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/js/custom.js b/js/custom.js index 8774cf5..d6dd53f 100644 --- a/js/custom.js +++ b/js/custom.js @@ -1,34 +1,34 @@ -// (function (Drupal, once) { -// Drupal.behaviors.removeTrailingZeros = { -// attach: function (context) { -// function processField(id) { -// var el = document.getElementById(id); -// if (!el) return; -// -// // If value isn't populated yet, wait and retry once -// if (el.value === "") { -// setTimeout(function () { -// processField(id); -// }, 100); -// return; -// } -// -// var str = el.value.toString().slice(0, -3); -// el.value = parseInt(str, 10); -// } -// -// once("from-slider", "#nouislider-input-from", context).forEach( -// function () { -// processField("nouislider-input-from"); -// } -// ); -// -// once("to-slider", "#nouislider-input-to", context).forEach(function () { -// processField("nouislider-input-to"); -// }); -// }, -// }; -// })(Drupal, once); +(function (Drupal, once) { + Drupal.behaviors.removeTrailingZeros = { + attach: function (context) { + function processField(id) { + var el = document.getElementById(id); + if (!el) return; + + // If value isn't populated yet, wait and retry once + if (el.value === "") { + setTimeout(function () { + processField(id); + }, 100); + return; + } + + var str = el.value.toString().slice(0, -3); + el.value = parseInt(str, 10); + } + + once("from-slider", "#nouislider-input-from", context).forEach( + function () { + processField("nouislider-input-from"); + } + ); + + once("to-slider", "#nouislider-input-to", context).forEach(function () { + processField("nouislider-input-to"); + }); + }, + }; +})(Drupal, once); // (function (Drupal) { // window.onload = function () { // var inputField = document.getElementById("nouislider-input-from");