From 061866fea3a3b54b1f60b0682c563cb9f31d0eaf Mon Sep 17 00:00:00 2001 From: Diatrex Date: Tue, 22 Dec 2020 10:59:36 +0300 Subject: [PATCH 1/8] #2967 [advs-module] Capitalize only first letter of each word --- .../visiosoft/advs-module/resources/js/location.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/default/visiosoft/advs-module/resources/js/location.js b/addons/default/visiosoft/advs-module/resources/js/location.js index 3c8af3e39..40a36ead5 100644 --- a/addons/default/visiosoft/advs-module/resources/js/location.js +++ b/addons/default/visiosoft/advs-module/resources/js/location.js @@ -87,9 +87,9 @@ function Locations(cat, level, name) { url: "/class/ajax", success: function (msg) { $('select[name="' + name + '"]').find('option').remove(); - $('select[name="' + name + '"]').append(''); + $('select[name="' + name + '"]').append(``); $.each(msg, function (key, value) { - $('select[name="' + name + '"]').append(''); + $(`select[name="${name}"]`).append(``); }); } }).promise().done(function () { @@ -98,6 +98,11 @@ function Locations(cat, level, name) { }); } +function capFirst(value) { + if (!value) return '' + return value.toLowerCase().replace(/(?:^|\s|["'([{])+\S/g, match => match.toUpperCase()); +} + function setLocation(level) { if (level == 1) { $('select[name="' + citySelectName + '"]').val(getCity); From 057dabfba3ddf4c78a13d76a39cf24bef02f3e21 Mon Sep 17 00:00:00 2001 From: Muammer Top Date: Wed, 23 Dec 2020 11:57:50 +0300 Subject: [PATCH 2/8] maden bug fixed on slack channel --- .../location-module/resources/js/filterLocation.js | 10 +++++++--- .../views/ads-list/partials/location-fields.twig | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/default/visiosoft/location-module/resources/js/filterLocation.js b/addons/default/visiosoft/location-module/resources/js/filterLocation.js index a7c9d9149..f6bc09b42 100644 --- a/addons/default/visiosoft/location-module/resources/js/filterLocation.js +++ b/addons/default/visiosoft/location-module/resources/js/filterLocation.js @@ -190,7 +190,7 @@ function SelectOnClick() { searchLocationName() $('.loading').hide(); - return $(".filter-location-body input[type='checkbox']").change(function () { + return $(".filter-location-body input[type='checkbox']").on('change', function () { resetValue($(this).attr('data-field'), false, true) @@ -202,7 +202,7 @@ function SelectOnClick() { var id = $(this).attr('data-id'); if ($(this).attr('data-field') == "country") { - $('.selected-city').html(''); + $('.selected-city small').html(''); $('input[name="city[]"]').val(''); // text_html.html(input_text) // $(".filter-location-body li[data-id='" + id + "'] input[type='checkbox']").prop('checked', true); @@ -247,7 +247,11 @@ function item(field_name, id, value, abv = '') { if (field_name === 'country') { return '
  • \n' + '
  • \n' + ' \n' + '
  • '; - } else { return '
  • \n' + '