Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong id of location field. #2

Closed
tickHub opened this issue Mar 17, 2015 · 3 comments
Closed

Wrong id of location field. #2

tickHub opened this issue Mar 17, 2015 · 3 comments
Assignees

Comments

@tickHub
Copy link

tickHub commented Mar 17, 2015

In geolocation.js you refer to the location field as locationField: $("#form-field-location")

But i think it should be locationField: $("#form-field-coordinates")

@rutger1140
Copy link
Owner

Thanks for reporting. I will investigate this.

@rutger1140 rutger1140 self-assigned this Mar 17, 2015
@tickHub
Copy link
Author

tickHub commented Mar 20, 2015

Ah! The field name is dynamic (specified in the blueprint file), so it can be everything of course.
You can fix it for now with locationField: $("[type=geolocation]"), as long if you facilitate only one instance per page.

@rutger1140
Copy link
Owner

@tickHub I was unaware that the field type in the blueprint is set as the <input type='geolocation'> in the panel directly. I thought it was only needed to activate the custom field.

It looks like this:

<input class="input input-is-readonly" type="geolocation" name="location" autocomplete="on" placeholder="Coordinates" readonly="" id="form-field-location" tabindex="-1" data-field="location">

When changing the field name to 'location2' it looks like this:

<input class="input input-is-readonly" type="geolocation" name="location2" autocomplete="on" placeholder="Coordinates" readonly="" id="form-field-location2" tabindex="-1" data-field="location">

Selecting an input on an 'invalid' type attribute doesn't feel like the way to go. I would rather stick with the id of the field and instruct people to use location as the field name in their blueprint. I will update the readme.

But please feel free to issue a PR if you have a solid solution for this. Maybe loop through all the input fields with data-field="location" to allow multiple instances?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants