Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To close issue #70 GoogleWebComponents/google-apis #71

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions google-client-loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,25 @@
errorEventName: {
type: String,
value: 'google-api-load-error'
},

_clientLoaded: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should both be readOnly: true and use the respective hidden setter to set the values.

type: Boolean,
value: false
},

// Used to fix events potentially being fired multiple times by
// iron-jsonp-library.
_waiting: {
type: Boolean,
value: false
}

},

// Used to fix events potentially being fired multiple times by
// iron-jsonp-library.
_waiting: false,
observers: [
'_tryLoadingApi(_waiting, _clientLoaded, name, version)'
],

/**
* Returns the loaded API.
Expand Down Expand Up @@ -172,6 +185,7 @@

_doneLoadingClient: function() {
_clientLoaded = true;
this._clientLoaded = true;
// Fix for API client load event being fired multiple times by
// iron-jsonp-library.
if (!this._waiting) {
Expand All @@ -188,6 +202,11 @@
return handler;
},

_tryLoadingApi: function(waiting, clientLoaded, name, version) {
if (!waiting && clientLoaded && name && version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brackets

this._loadApi();
},

_loadApi: function() {
if (_clientLoaded && this.name && this.version) {
this._waiting = false;
Expand Down