Open salexzee opened 9 years ago
Autocomplete feature is finished. Start typing an address and it will bias to your current geographical location, but will not prevent you from putting an address for anywhere in the world.
Seems like sometimes the autocomplete feature doesn't work the first time you load the page, but if you reload, it will then work. That's a bug I need to work out.
Ok I just pushed up the fix for autocomplete. It was all the fault of Turbolinks. Basically, Turbolinks doesn't fully load entire pages when you click on a link inside of the application. In doing this, it greatly speeds up the application when switching pages. The issue it was giving me was that since it wasn't fully loading the page, $(document).ready()
function wasn't firing unless you did a full reload of the page. To get it working, I had to give the links to the new event page and edit event page a data
attribute of no-turbolink
which corrected the issue. Those pages will comparatively load slower than the other pages but I don't think there will be a noticeable difference. At least not until this application becomes the biggest thing since Twitter.
Didn't mean to close this. There's still more that can be done down this path.
Yes, Turbolinks causes problems with $(document).ready as it's secretly loading in the next page content so that when you change pages, the document is never "ready". One workaround is to use $(document).on('page:change')
instead, or as you discovered, disabling turbolinks.
This is why when DHH said about turbolinks 3 in his keynote: “The thing about turbolinks 3, is, its getting greedy.”, made me say, "the thing about tubolinks 3...is it's getting disabled...by me..."
For people setting up an event, when they get to the part that asks for a location, I think it should link to the Google Maps API which would make it possible to get directions and so on.