Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 835329 - [DIALER] Timer is not appearing during an outgoing call (r=@etiennesegonzac) #7867

Merged
merged 1 commit into from
Feb 5, 2013
Merged

Bug 835329 - [DIALER] Timer is not appearing during an outgoing call (r=@etiennesegonzac) #7867

merged 1 commit into from
Feb 5, 2013

Conversation

gtorodelvalle
Copy link
Contributor

The localization feature was not working in the Comms incoming and outgoing attention screens due to a problem in the lazy loading of this feature.

The source of the problem in this code snippet: https://github.com/mozilla-b2g/gaia/blob/master/shared/js/l10n.js#L949

More concretely, in the case of the incoming/outgoing attention screen, the lazy loading of the localization feature in the Comms app caused the previously mentioned code snippet to be executed with document.readyState equal to 'interactive' and consequently the listener added via document.addEventListener('DOMContentLoaded', l10nStartup) never ran (since the DOMContentLoaded has been already fired, if not the document.readyState wouldn't be 'interactive') and consequently the l10nStartup function was never executed which was causing the localization capabilities to fail ;-999

@gtorodelvalle
Copy link
Contributor Author

r ? @etiennesegonzac

} else {
} else if (document.readyState === 'interactive') {
window.addEventListener('load', l10nStartup);
} else if (document.readyState === 'loading') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually when the state is interactive we can go ahead, let's have

  if (typeof(document) !== 'undefined') {
    if (document.readyState === 'complete' ||
        document.readyState === 'interactive') {
      window.setTimeout(l10nStartup);
    } else {
      document.addEventListener('DOMContentLoaded', l10nStartup);
    }
  }

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Including it and testing it... ;-) Thanks!

@gtorodelvalle
Copy link
Contributor Author

@etiennesegonzac , suggestion included and working... ;-) If you are OK with the final changes, please be my guest and merge the pull request... ;-) I'll evolve the bug in Bugzilla to fixed as soon as you merge it ;-) Thanks!

@gtorodelvalle
Copy link
Contributor Author

Switching to Mr. @arcturus since Mr. @etiennesegonzac is enjoying a more than deserved holidays... ;-) Please, @arcturus , would you be so kind to check this PR including @etiennesegonzac 's comment? Thank you very much!

@arcturus
Copy link
Contributor

arcturus commented Feb 5, 2013

r=me (in the absence of @etiennesegonzac :P)

@gtorodelvalle
Copy link
Contributor Author

Merging it ;-) Thank you guys! :-)

gtorodelvalle added a commit that referenced this pull request Feb 5, 2013
…ation-not-loading-in-attention-screen

Bug 835329 - [DIALER] Timer is not appearing during an outgoing call (r=@etiennesegonzac)
@gtorodelvalle gtorodelvalle merged commit 345162a into mozilla-b2g:master Feb 5, 2013
gtorodelvalle added a commit that referenced this pull request Feb 7, 2013
…ation-not-loading-in-attention-screen

Bug 835329 - [DIALER] Timer is not appearing during an outgoing call (r=@etiennesegonzac)(cherry picked from commit 345162a)
gtorodelvalle added a commit that referenced this pull request Feb 7, 2013
…ation-not-loading-in-attention-screen

Bug 835329 - [DIALER] Timer is not appearing during an outgoing call (r=@etiennesegonzac)(cherry picked from commit 345162a)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants