diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-04 17:37:49 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-04 17:37:49 -0700 |
commit | 651c02c50f42cc9fc1e3dfcc9f68d9a047a44242 (patch) | |
tree | b4cc2ac63b26898d85416c58e35a1dbf0054dd88 /src | |
parent | 89b16b2a4e1f3af7718c5db0113974d1105a95c9 (diff) | |
download | DotNetOpenAuth-651c02c50f42cc9fc1e3dfcc9f68d9a047a44242.zip DotNetOpenAuth-651c02c50f42cc9fc1e3dfcc9f68d9a047a44242.tar.gz DotNetOpenAuth-651c02c50f42cc9fc1e3dfcc9f68d9a047a44242.tar.bz2 |
Fixed intermittent javascript error in IE.
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js index 86613fb..a3a6949 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js @@ -270,24 +270,29 @@ window.dnoa_internal.DiscoveryResult = function(identifier, discoveryInfo) { // for a negative assertion. We must be able to recover from that scenario. var thisServiceEndpointLocal = thisServiceEndpoint; thisServiceEndpoint.popupCloseChecker = window.setInterval(function() { - if (thisServiceEndpointLocal.popup && thisServiceEndpointLocal.popup.closed) { - // The window closed, either because the user closed it, canceled at the OP, - // or approved at the OP and the popup window closed itself due to our script. - // If we were graying out the entire page while the child window was up, - // we would probably revert that here. - window.clearInterval(thisServiceEndpointLocal.popupCloseChecker); - thisServiceEndpointLocal.popup = null; - - // The popup may have managed to inform us of the result already, - // so check whether the callback method was cleared already, which - // would indicate we've already processed this. - if (window.dnoa_internal.processAuthorizationResult) { - trace('User or OP canceled by closing the window.'); - if (thisDiscoveryResult.onAuthFailed) { - thisDiscoveryResult.onAuthFailed(thisDiscoveryResult, thisServiceEndpoint); + if (thisServiceEndpointLocal.popup) { + if (thisServiceEndpointLocal.popup.closed) { + // The window closed, either because the user closed it, canceled at the OP, + // or approved at the OP and the popup window closed itself due to our script. + // If we were graying out the entire page while the child window was up, + // we would probably revert that here. + window.clearInterval(thisServiceEndpointLocal.popupCloseChecker); + thisServiceEndpointLocal.popup = null; + + // The popup may have managed to inform us of the result already, + // so check whether the callback method was cleared already, which + // would indicate we've already processed this. + if (window.dnoa_internal.processAuthorizationResult) { + trace('User or OP canceled by closing the window.'); + if (thisDiscoveryResult.onAuthFailed) { + thisDiscoveryResult.onAuthFailed(thisDiscoveryResult, thisServiceEndpoint); + } + window.dnoa_internal.processAuthorizationResult = null; } - window.dnoa_internal.processAuthorizationResult = null; } + } else { + // if there's no popup, there's no reason to keep this timer up. + window.clearInterval(thisServiceEndpointLocal.popupCloseChecker); } }, 250); }; |