wuwanahq / wuwana2

🇪🇺 Wuwana v2 - A webapp to help users find local suppliers in Spain.
Mozilla Public License 2.0
2 stars 2 forks source link

[Mobile] - Apply filter in menu does not work #61

Closed levogirar closed 3 years ago

Doburo commented 3 years ago

Change:

if (getComputedStyle(this).getPropertyValue("display") == "none")
    {
        // Mobile
        var checkbox = document.getElementById(this.id.substr(0,1) + "0");
        checkbox.disabled = false;
        checkbox.checked = false;
    }

to:

if (getComputedStyle(this).getPropertyValue("display") == "none")
{
    let changeUrl = function()
    {
            let region_url = ''
            let region_array = document.querySelectorAll('input[name]')
            region_array.forEach((elem) => {
                if(elem.checked && elem.name != 'region') {
                        region_url += elem.name + '=on&'}
        })
        window.location = '?' + region_url.slice(0, -1)
    }

    let submit_button = document.querySelector(".Button.Center")

    submit_button.addEventListener('click', changeUrl)
levogirar commented 3 years ago

Hello @Doburo,

Thank you so much for your comment. It has helped us fix the problem. Out of curiosity, how did you find us?

Jonathan

Doburo commented 3 years ago

Immediately apologize for my bad english. I worked on my front-end developments, and cleanly inspected the code while writing js scripts. So I just went to your site, looked that your button was not "attached" any listening for click events... A little time with the Google Chrome console and that's it ...

levogirar commented 3 years ago

Thank you for your response, and your English is great.

I meant how did you find this project on Github?

Doburo commented 3 years ago

Short story: GitHub -> Explore -> Topix -> Php -> Least recently updated and urs project in 3rd line (was) That's all...

levogirar commented 3 years ago

Great! thank you for letting us know.