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

Commit

Permalink
Bug 909706 - Keyboard manager must wait for applicationready to enume…
Browse files Browse the repository at this point in the history
…rate all keyboard apps
  • Loading branch information
mpizza committed Sep 2, 2013
1 parent 01bb2a1 commit 65abc8c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion apps/system/index.html
Expand Up @@ -20,7 +20,8 @@
<script defer src="shared/js/mime_mapper.js"></script>
<script defer src="shared/js/settings_url.js"></script>
<script defer src="shared/js/advanced_timer.js"></script>
<script defer src="shared/js/keyboard_helper.js"></script>
<script defer src="shared/js/lazy_loader.js"></script>
<!-- <script defer src="shared/js/keyboard_helper.js"></script> -->

<!-- Wrapper -->
<link rel="stylesheet" type="text/css" href="style/wrapper/wrapper.css">
Expand Down
12 changes: 10 additions & 2 deletions apps/system/js/keyboard_manager.js
Expand Up @@ -85,7 +85,6 @@ var KeyboardManager = {
this.keyboardFrameContainer.classList.add('hide');

// get enabled keyboard from mozSettings, parse their manifest
this.updateLayouts();

// For Bug 812115: hide the keyboard when the app is closed here,
// since it would take a longer round-trip to receive focuschange
Expand Down Expand Up @@ -495,4 +494,13 @@ var KeyboardManager = {
}
};

KeyboardManager.init();
if (Applications.ready) {
KeyboardManager.init();
LazyLoader.load('shared/js/keyboard_helper.js');
} else {
window.addEventListener('applicationready', function mozAppsReady(event) {
window.removeEventListener('applicationready', mozAppsReady);
KeyboardManager.init();
LazyLoader.load('shared/js/keyboard_helper.js');
});
}

0 comments on commit 65abc8c

Please sign in to comment.