Collect references to Whisper.events

Fixup

// FREEBIE
This commit is contained in:
lilia 2017-04-24 17:59:11 -07:00 committed by Scott Nonnenberg
parent f7c7e2251d
commit a2e0fa59c1
No known key found for this signature in database
GPG key ID: A4931C09644C654B
4 changed files with 23 additions and 13 deletions

View file

@ -7,15 +7,15 @@
initialize: function(options) {
this.inboxView = null;
this.installView = null;
this.events = options.events;
this.events.on('openStandalone', this.openStandaloneInstaller, this);
this.events.on('openConversation', this.openConversation, this);
this.events.on('openInstaller', this.openInstaller, this);
this.events.on('openInbox', this.openInbox, this);
},
events: {
'openInstaller': 'openInstaller',
'openInbox': 'openInbox',
},
openView: function(view) {
this.el.innerHTML = "";
this.el.append(view.el);
this.delegateEvents();
},
openInstaller: function() {
this.closeInstaller();
@ -26,10 +26,12 @@
}
this.openView(this.installView);
},
openStandaloneInstaller: function() {
this.closeInstaller();
this.installView = new Whisper.StandaloneRegistrationView();
this.openView(this.installView);
openStandalone: function() {
if (window.config.environment !== 'production') {
this.closeInstaller();
this.installView = new Whisper.StandaloneRegistrationView();
this.openView(this.installView);
}
},
closeInstaller: function() {
if (this.installView) {