Skip to content

Commit

Permalink
Dynamically load google api dependencies on click
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoger committed Aug 12, 2016
1 parent ad713ff commit 5000f52
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/google-picker.js
Expand Up @@ -61,7 +61,7 @@
/**
* Load required modules
*/
function instanciate () {
function instantiate () {
gapi.load('auth', { 'callback': onApiAuthLoad });
gapi.load('picker');
}
Expand Down Expand Up @@ -139,11 +139,9 @@
});
}

gapi.load('auth');
gapi.load('picker');

element.bind('click', function (e) {
instanciate();
/* dynamically load dependencies only on click */
instantiate();
});
}
}
Expand Down

0 comments on commit 5000f52

Please sign in to comment.