diff --git a/addons/default/visiosoft/profile-module/resources/assets/js/ads.js b/addons/default/visiosoft/profile-module/resources/assets/js/ads.js index 4eb5a77f9..59549d48c 100644 --- a/addons/default/visiosoft/profile-module/resources/assets/js/ads.js +++ b/addons/default/visiosoft/profile-module/resources/assets/js/ads.js @@ -44,6 +44,8 @@ function changePage(page) { objJson[i].cat2_name, objJson[i].status)); } + addDropdownBlock() + page_span.html(page + "/" + numPages()); if (numPages() === 1) { @@ -166,10 +168,15 @@ function dropdownRow(id, type) { dropdown += ""; - getBlock('profile/dropdown-ad', {'id': id}, function (r) { - $(`.my-ads-dropdown[data-id=${id}] .dropdown-menu`).append(r.html) - }) - return dropdown; +} -} \ No newline at end of file +const dropdownBlock = getBlock('profile/dropdown-ad', {'id': ':id'}) +function addDropdownBlock () { + const dropdowns = $('.my-ads-dropdown') + for (let i = 0; i < dropdowns.length; i++) { + console.log() + const currentDropdown = $(dropdowns[i]) + $('.dropdown-menu', currentDropdown).append(dropdownBlock.replace(':id', currentDropdown.data('id'))) + } +}