Skip Navigation

[Resolved] Disable js-toolset-maps-distance-current-location

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to disable the distance button on his parametric search.

Solution:

To disable the button you can use the js code below.

jQuery(document).ready(function(){
    jQuery('.js-toolset-maps-distance-current-location').attr('disabled','disabled');
  });
This support ticket is created 6 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 28 replies, has 3 voices.

Last updated by markusK-6 6 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#683979

Hello,

how can I disable the button js-toolset-maps-distance-current-location?

Nice Regards
Markus

#686995

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

Thank you for contacting our support forum.

You should be able to disable the button by using the javascript below.

jQuery(document).ready(function(){
    jQuery('.js-toolset-maps-distance-current-location').attr('disabled','disabled');
  });

Please try this and let me know if it helps.

Thanks,
Shane

#691170

Hi Shane,

thank you, the button is disabled but still visible, how can I set this to display: none.
Furthermore after a search the button is active again.

exampel: hidden link

#692105

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

TO hide the button you can add this javascript as well

jQuery(document).ready(function(){
    jQuery('.js-toolset-maps-distance-current-location').attr('disabled','disabled');
jQuery(".js-toolset-maps-distance-current-location").hide();
  });

Is it that you want this button to appear again after the search has been performed?

Please let me know.

Thanks,
Shane

#692788

it works, but it is active and visible after changing pagination!

#692799

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

Do you want this button to be permanently hidden ?

Please let me know

#693143

yes please

#694418

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

Use this css instead.

.js-toolset-maps-distance-current-location{
display: none !important;
}

This should permanently hide it.

Thanks,
Shane

#696357
location-browser.png

Hi Shane,

thank you, that works, but still there is a browser question to allow location on browser when i change the radius search.
How can i disable this funktion completely?

#698203

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

Since i'm seeing the site in English i'm not sure what this says because it doesn't appear for me.

I'm assuming its asking for permission to get your current location.

This is because of the distance filter. Unfortunately this does not appear for me.

Thanks,
Shane

#712963
browser.png

Hi Shane,

yes the browser is asking for permission to get your current location.
To adjust that, please proceed as follows:

- hidden link
- type in location "langenfeld"
- change the radius to 5
than appears the browser question.

How can i disable that browser question?

Nice regards
Markus

#717071

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

Unfortunately since you are using the distance filter for views then it will require the permission of your browser to know your location so the filter works adequately .

Nothing we can do about this because without the permission then the filter wont work.

Thanks,
Shane

#726710

Hi Shane,

thank you but that is not correct.
Bevor i switched the site to Https everythins works good and the browser question was not there.
Now on https the button locate my location appears and produces this browser query.
If I disallow the question the results are correct because i type the location manually, So i Think that the browser query is not necessary.

Nice regards Markus

#728718

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Markus,

This could just be on your end because i've asked my colleagues to have a look at the link and they are not getting this request.

Thanks,
Shane

#731761

Hi Shane,

to adjust that, please proceed as follows:

- hidden link
- type in location "langenfeld"
- change the radius to 5 and press ENTER
than appears the browser question.

I Think at this moment when i press ENTER the function search my location activates because we have disabled it not correctly.