Closed tasomaniac closed 9 years ago
Great idea! One solution is to call or not to call that function from the page. Here is where you can put that call. For instance:
{% elsif page.permalink == '/logistics/' %}
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places,geometry"></script>
{% if site.logisticsMapAutoDirections %}
callAutoDirection();
{% endif %}
{% endif %}
Ok, I will try it and update this PR.
I already tried to put in findway.html
but it didn't see the javascript resources. I think I see why was the reason now, it should be in the defaults.html
. ty.
Hey!
I have just updated the PR.
So I have tried your suggestion but it didn't directly work. It was because all of the functions related to maps are scoped and I cannot directly access them in html.
Secondly, I tried sending jQuery events to scripts.js
and tried to do it there, but it didn't worked because maps not ready immediately.
And again, I cannot access to the maps object directly.
At the end, I am converting the Jekyll variable to a JS variable and using it in scripts.js
. With this we can minify it.
What do you think?
Cool! That's what I have tried to explain you. Thanks for the contribution again!
Thanks for the great project again :)
Added a configuration for Jekyll to enable/disable auto directions in Logistics page.
I have seen several people using the web site and no once noticed "my location" button in the Logistics page. So I decided to get their location immediately when they open Logistics page.
And then I thought it may be a config after all.
I am an Android developer. So I am a newbie to this. So please guide me. :smile:
With this code when I change scripts.min.js to scripts.js it works. But it cannot be minified because minifier thinks that {% illegal. What should I do? Thank you.