Skip to content

Commit 8ef4b9e

Browse files
Merge pull request #32 from jhoger/lateLoad
Dynamically load google api dependencies on click
2 parents ad713ff + 5000f52 commit 8ef4b9e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/google-picker.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
/**
6262
* Load required modules
6363
*/
64-
function instanciate () {
64+
function instantiate () {
6565
gapi.load('auth', { 'callback': onApiAuthLoad });
6666
gapi.load('picker');
6767
}
@@ -139,11 +139,9 @@
139139
});
140140
}
141141

142-
gapi.load('auth');
143-
gapi.load('picker');
144-
145142
element.bind('click', function (e) {
146-
instanciate();
143+
/* dynamically load dependencies only on click */
144+
instantiate();
147145
});
148146
}
149147
}

0 commit comments

Comments
 (0)