Support late-addition of default image to file input

Fixes #256

// FREEBIE
This commit is contained in:
lilia 2015-06-05 11:22:36 -07:00
parent 061d57c95a
commit 583fb98cce

View file

@ -28,7 +28,6 @@
this.$input = this.$('input[type=file]'); this.$input = this.$('input[type=file]');
this.thumb = new Whisper.AttachmentPreviewView(); this.thumb = new Whisper.AttachmentPreviewView();
this.$el.addClass('file-input'); this.$el.addClass('file-input');
this.$default = this.$('.default');
this.window = options.window; this.window = options.window;
}, },
@ -56,7 +55,7 @@
}, },
addThumb: function(src) { addThumb: function(src) {
this.$default.hide(); this.$('.default').hide();
this.thumb.src = src; this.thumb.src = src;
this.$('.thumbnail').append(this.thumb.render().el); this.$('.thumbnail').append(this.thumb.render().el);
}, },
@ -215,7 +214,7 @@
this.oUrl = null; this.oUrl = null;
} }
this.thumb.remove(); this.thumb.remove();
this.$default.show(); this.$('.default').show();
}, },
deleteFiles: function(e) { deleteFiles: function(e) {