Skip Navigation

[Resolved] Hide "my location" icon

This support ticket is created 4 years, 1 month 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)

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by miroslavI 4 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#1793025

Tell us what you are trying to do? Hide icon in filter hidden link

Is there any documentation that you are following? Hide with JS code but when you use filter, icon appear.

Is there a similar example that we can see?

What is the link to your site? hidden link

I successfully hide location icon with this code:
jQuery( document ).ready(function() {
jQuery(".js-toolset-maps-distance-current-location").prop("value", "Nájdi moju lokalitu");
});

But when you click on filter, icon show up :-O
Thanks for help.

#1793419

Shane
Supporter

Languages: English (English )

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

Hi Miroslav,

Thank you for getting in touch.
The reason for this is because you need to add your function to the Javascript callback for when the search has been triggered.

jQuery( document ).on( 'js_event_wpv_parametric_search_triggered', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.form (object) The jQuery object for the View form
	* data.update_form (bool) Whether the custom search form will be updated
	* data.update_results (bool) Whether the custom search results will be updated
	*/
	
});

Add your function within this and it will activate again after the search has been triggered.

Please let me know if this helps to resolve your issue.

Thanks,
Shane

#1793993
toolset-bug.PNG

hello, i place your code to the view but it still not working see attached image. thank you for your help

#1794409

Shane
Supporter

Languages: English (English )

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

Hi Miroslav,

You will need to add your function within the callback function that i've provided.

Example

jQuery( document ).ready(function() {
jQuery(".js-toolset-maps-distance-current-location").prop("value", "Nájdi moju lokalitu");
});
jQuery( document ).on( 'js_event_wpv_parametric_search_triggered', function( event, data ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.form (object) The jQuery object for the View form
    * data.update_form (bool) Whether the custom search form will be updated
    * data.update_results (bool) Whether the custom search results will be updated
    */
     jQuery( document ).ready(function() {
jQuery(".js-toolset-maps-distance-current-location").prop("value", "Nájdi moju lokalitu");
});

});

So your final code should look like above.
Thanks,
Shane

#1795507
Screen Shot 09-30-20 at 01.29 PM.PNG

Hi, sorry but still not working, see attached image.

#1796045

Shane
Supporter

Languages: English (English )

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

Hi Miroslav,

Let us use the filter that will fire after you've submitted the form.

jQuery( document ).ready(function() {
jQuery(".js-toolset-maps-distance-current-location").prop("value", "Nájdi moju lokalitu");
});

jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
jQuery(".js-toolset-maps-distance-current-location").prop("value", "Nájdi moju lokalitu");

});

This should cause it to work now.

#1801363

My issue is resolved now. Thank you!