| Index: lib/appSupport.js |
| =================================================================== |
| --- a/lib/appSupport.js |
| +++ b/lib/appSupport.js |
| @@ -702,7 +702,11 @@ |
| this.window = window; |
| this.callback = callback; |
| this.onSelect = this.onSelect.bind(this); |
| - this.attach(); |
| + this.attach = this.attach.bind(this); |
| + if (window.BrowserApp.deck) |
| + this.attach(); |
| + else |
| + window.addEventListener("UIReady", this.attach, false); |
| }; |
| BrowserChangeListener.prototype = { |
| window: null, |
| @@ -730,8 +734,8 @@ |
| attach: function() |
| { |
| + this.window.removeEventListener("UIReady", this.attach, false); |
| this.onSelect(); |
| - |
| this.window.BrowserApp.deck.addEventListener("TabSelect", this.onSelect, false); |
| }, |
| detach: function() |