Pass windows around to let file inputs work

This commit is contained in:
lilia 2015-06-04 13:29:01 -07:00
parent 3d1df790a5
commit cdb7fcfbad
4 changed files with 11 additions and 5 deletions

View file

@ -144,7 +144,8 @@
newGroupUpdate: function() { newGroupUpdate: function() {
this.newGroupUpdateView = new Whisper.NewGroupUpdateView({ this.newGroupUpdateView = new Whisper.NewGroupUpdateView({
model: this.model model: this.model,
window: this.appWindow.contentWindow
}); });
this.newGroupUpdateView.$el.insertAfter(this.el); this.newGroupUpdateView.$el.insertAfter(this.el);
this.$el.hide(); this.$el.hide();

View file

@ -59,7 +59,9 @@
initialize: function (options) { initialize: function (options) {
this.render(); this.render();
this.newConversationView = new Whisper.NewConversationView(); this.newConversationView = new Whisper.NewConversationView({
appWindow: options.appWindow
});
this.newConversationView.$el.hide(); this.newConversationView.$el.hide();
this.listenTo(this.newConversationView, 'open', this.listenTo(this.newConversationView, 'open',
this.openConversation.bind(this, null)); this.openConversation.bind(this, null));

View file

@ -20,15 +20,17 @@
Whisper.NewConversationView = Whisper.View.extend({ Whisper.NewConversationView = Whisper.View.extend({
className: 'new-conversation', className: 'new-conversation',
template: $('#new-conversation').html(), template: $('#new-conversation').html(),
initialize: function() { initialize: function(options) {
this.render(); this.render();
this.$group_update = this.$('.new-group-update-form'); this.$group_update = this.$('.new-group-update-form');
this.$create = this.$('.create'); this.$create = this.$('.create');
this.$input = this.$('input.search'); this.$input = this.$('input.search');
// Group avatar file input // Group avatar file input
this.appWindow = options.appWindow;
this.avatarInput = new Whisper.FileInputView({ this.avatarInput = new Whisper.FileInputView({
el: this.$('.group-avatar') el: this.$('.group-avatar'),
window: this.appWindow.contentWindow
}); });
this.recipients_view = new Whisper.RecipientsInputView(); this.recipients_view = new Whisper.RecipientsInputView();

View file

@ -24,7 +24,8 @@
initialize: function(options) { initialize: function(options) {
this.render(); this.render();
this.avatarInput = new Whisper.FileInputView({ this.avatarInput = new Whisper.FileInputView({
el: this.$('.group-avatar') el: this.$('.group-avatar'),
window: options.window
}); });
this.recipients_view = new Whisper.RecipientsInputView(); this.recipients_view = new Whisper.RecipientsInputView();