Skip to content
This repository has been archived by the owner on May 10, 2019. It is now read-only.

Commit

Permalink
rename loggedInEmail to loggedInUser with backcompat support. issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
lloyd committed Jun 20, 2012
1 parent 837d4c1 commit 432b759
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions resources/static/include_js/include.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,13 +1027,25 @@

_open_hidden_iframe();

// back compat support for loggedInEmail
if (typeof options.loggedInEmail !== 'undefined' &&
typeof options.loggedInUser !== 'undefined')
{
throw "you cannot supply *both* loggedInEmail and loggedInUser";
}
else if(typeof options.loggedInEmail !== 'undefined')
{
options.loggedInUser = options.loggedInEmail;
delete options.loggedInEmail;
}

// check that the commChan was properly initialized before interacting with it.
// on unsupported browsers commChan might still be undefined, in which case
// we let the dialog display the "unsupported browser" message upon spawning.
if (typeof options.loggedInEmail !== 'undefined' && commChan) {
if (typeof options.loggedInUser !== 'undefined' && commChan) {
commChan.notify({
method: 'loggedInUser',
params: options.loggedInEmail
params: options.loggedInUser
});
}
}
Expand Down

0 comments on commit 432b759

Please sign in to comment.