move main application view over to messageReceiver namespace
The goal here is to allow synchronous property lookup between objects and mvc/backbone semantics. // FREEBIE
This commit is contained in:
parent
ef4b4da2a3
commit
e4a21d1a53
3 changed files with 45 additions and 18 deletions
24
js/index.js
24
js/index.js
|
@ -15,25 +15,15 @@
|
|||
logError(error);
|
||||
};
|
||||
|
||||
var view;
|
||||
|
||||
function render() {
|
||||
extension.windows.getBackground(function(bg) {
|
||||
bg.ConversationController.updateInbox().then(function() {
|
||||
try {
|
||||
if (view) { view.remove(); }
|
||||
var $body = bg.$('body',document).empty();
|
||||
view = new bg.Whisper.InboxView({window: window});
|
||||
view.$el.prependTo($body);
|
||||
window.openConversation = function(conversation) {
|
||||
if (conversation) {
|
||||
view.openConversation(null, conversation);
|
||||
}
|
||||
};
|
||||
openConversation(bg.getOpenConversation());
|
||||
} catch (e) {
|
||||
logError(e);
|
||||
}
|
||||
|
||||
var inboxPromise = bg.initLoading.done(function(owsDesktopApp) {
|
||||
owsDesktopApp.getAppView(window).then(function(appView) {
|
||||
var bodyEl = document.getElementById('signal-container');
|
||||
bodyEl.innerHTML = "";
|
||||
bodyEl.append(appView.el);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue