DRY up audio and video views

This commit is contained in:
lilia 2015-03-03 13:05:39 -08:00
parent df06499a19
commit f9ca13a86f

View file

@ -24,19 +24,7 @@
}
});
var AudioView = Backbone.View.extend({
tagName: 'audio',
initialize: function() {
this.$el.attr('controls', '');
},
render: function(dataUrl) {
this.$el.attr('src', dataUrl);
return this;
}
});
var VideoView = Backbone.View.extend({
tagName: 'video',
var MediaView = Backbone.View.extend({
initialize: function() {
this.$el.attr('controls', '');
},
@ -49,6 +37,9 @@
}
});
var AudioView = MediaView.extend({ tagName: 'audio' });
var VideoView = MediaView.extend({ tagName: 'video' });
Whisper.AttachmentView = Backbone.View.extend({
tagName: 'span',
className: 'attachment',