DRY up audio and video views

pull/749/head
lilia 10 years ago
parent df06499a19
commit f9ca13a86f

@ -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',

Loading…
Cancel
Save