Skip to content

Commit 4f4fbbe

Browse files
authored
Merge pull request #73 from GoogleWebComponents/fix72
Fixes #72
2 parents 1e2d574 + 787c470 commit 4f4fbbe

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

google-client-loader.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
3636
@demo
3737
-->
38-
<dom-module id="google-client-loader">
39-
<template>
40-
<google-js-api on-js-api-load="_loadClient"></google-js-api>
41-
</template>
42-
</dom-module>
4338

4439
<script>
4540
(function() {
@@ -115,6 +110,10 @@
115110
}
116111
},
117112

113+
hostAttributes: {
114+
hidden: true // remove from rendering tree.
115+
},
116+
118117
// Used to fix events potentially being fired multiple times by
119118
// iron-jsonp-library.
120119
_waiting: false,
@@ -138,6 +137,15 @@
138137
return gapi.auth;
139138
},
140139

140+
ready: function() {
141+
this._loader = document.createElement('google-js-api');
142+
this.listen(this._loader, 'js-api-load', '_loadClient');
143+
},
144+
145+
detached: function() {
146+
this.unlisten(this._loader, 'js-api-load', '_loadClient');
147+
},
148+
141149
_loadClient: function() {
142150
gapi.load('client', this._doneLoadingClient.bind(this));
143151
},

0 commit comments

Comments
 (0)