DRY up audio and video views
This commit is contained in:
@@ -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',
|
||||
|
Reference in New Issue
Block a user