Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
avoid global; loaded() could be called immediately after load(), so make
Browse files Browse the repository at this point in the history
sure that case is working
  • Loading branch information
frankiefu committed Jan 21, 2014
1 parent 8018c28 commit b3e94ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions polymer-google-jsapi.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
d.close();
}
var api;
loaded = function(google) {
var loaded = function(google) {
window.__polymer_google_jsapi = undefined;
window.google = api = google;
instances.forEach(function(i) {
i.notify();
i.provide();
});
}
var loader =
Expand All @@ -36,8 +36,10 @@
ready: function() {
switch (state) {
case '':
instances.push(this);
load();
state = 'pending';
break;
case 'pending':
instances.push(this);
break;
Expand Down

0 comments on commit b3e94ca

Please sign in to comment.