Skip to content

Commit

Permalink
update js
Browse files Browse the repository at this point in the history
  • Loading branch information
Olicek committed Apr 1, 2015
1 parent 7cba54d commit b3b8b14
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor/
*.lock
19 changes: 11 additions & 8 deletions client-side/googleMapAPI.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
/**
* Copyright (c) 2015 Petr Olišar (http://olisar.eu)
*
* For the full copyright and license information, please view
* the file LICENSE.md that was distributed with this source code.
*/


var GoogleMap = GoogleMap || {};

GoogleMap = function(element)
Expand Down Expand Up @@ -259,6 +259,11 @@ var map;
Array.prototype.forEach.call(document.getElementsByClassName('googleMapAPI'), function(el, i){
map = new GoogleMap(el);
map.doProportions();
if (typeof google === "undefined") {
loadScript();
} else {
map.initialize();
}
});

function loadScript() {
Expand All @@ -268,6 +273,4 @@ function loadScript() {
script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&' +
'callback=map.initialize'+key;
document.body.appendChild(script);
}

window.onload = loadScript;
}
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
}
],
"require": {
"php": ">=5.3.0",
"php": ">=5.4.0"
},
"require-dev": {
"nette/nette": ">=2.1"
},
"autoload": {
Expand Down

0 comments on commit b3b8b14

Please sign in to comment.