mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 04:09:49 +00:00
Rename Whisper.View#attributes
Avoid colliding with Backbone.View attributes, which is a list of attrs to set on the html element for a view.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
Whisper.AttachmentPreviewView = Whisper.View.extend({
|
||||
className: 'attachment-preview',
|
||||
template: $('#attachment-preview').html(),
|
||||
attributes: function() {
|
||||
render_attributes: function() {
|
||||
return {source: this.src};
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
return [ 'conversation', this.model.get('type') ].join(' ');
|
||||
},
|
||||
template: $('#conversation').html(),
|
||||
attributes: function() {
|
||||
render_attributes: function() {
|
||||
return { group: this.model.get('type') === 'group' };
|
||||
},
|
||||
initialize: function() {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
});
|
||||
},
|
||||
attributes: function() {
|
||||
render_attributes: function() {
|
||||
return {
|
||||
your_key: this.splitKey(this.model.your_key),
|
||||
their_key: this.splitKey(this.model.their_key)
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
this.$el.trigger('remove', {modelId: this.model.id});
|
||||
this.remove();
|
||||
},
|
||||
attributes: function() {
|
||||
render_attributes: function() {
|
||||
return { name: this.model.getTitle() };
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
Backbone.View.apply(this, arguments);
|
||||
Mustache.parse(_.result(this, 'template'));
|
||||
},
|
||||
attributes: function() {
|
||||
render_attributes: function() {
|
||||
return _.result(this.model, 'attributes', {});
|
||||
},
|
||||
render: function() {
|
||||
var attrs = _.result(this, 'attributes', {});
|
||||
var attrs = _.result(this, 'render_attributes', {});
|
||||
var template = _.result(this, 'template', '');
|
||||
this.$el.html(Mustache.render(template, attrs));
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user