Simplify openConversation
Now that the InboxView is initialized in the background page context, we can manipulate it more directly, without going through a global function on the foreground window. // FREEBIE
This commit is contained in:
@@ -308,12 +308,7 @@
|
|||||||
try {
|
try {
|
||||||
if (self.inboxView) { self.inboxView.remove(); }
|
if (self.inboxView) { self.inboxView.remove(); }
|
||||||
self.inboxView = new Whisper.InboxView({model: self, window: destWindow});
|
self.inboxView = new Whisper.InboxView({model: self, window: destWindow});
|
||||||
destWindow.openConversation = function(conversation) {
|
self.openConversation(getOpenConversation());
|
||||||
if (conversation) {
|
|
||||||
self.inboxView.openConversation(null, conversation);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
destWindow.openConversation(getOpenConversation());
|
|
||||||
|
|
||||||
return self.inboxView;
|
return self.inboxView;
|
||||||
|
|
||||||
@@ -321,6 +316,11 @@
|
|||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
openConversation: function(conversation) {
|
||||||
|
if (this.inboxView && conversation) {
|
||||||
|
this.inboxView.openConversation(null, conversation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -97,7 +97,7 @@
|
|||||||
var open;
|
var open;
|
||||||
window.openConversation = function(conversation) {
|
window.openConversation = function(conversation) {
|
||||||
if (inboxOpened === true) {
|
if (inboxOpened === true) {
|
||||||
appWindow.contentWindow.openConversation(conversation);
|
owsDesktopApp.openConversation(conversation);
|
||||||
} else {
|
} else {
|
||||||
open = conversation;
|
open = conversation;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user