Skip to content

Commit 5000f52

Browse files
committed
Dynamically load google api dependencies on click
1 parent ad713ff commit 5000f52

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/google-picker.js

Lines changed: 3 additions & 5 deletions
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)