diff --git a/js/views/attachment_preview_view.js b/js/views/attachment_preview_view.js index ce72f1b1..9daf06b8 100644 --- a/js/views/attachment_preview_view.js +++ b/js/views/attachment_preview_view.js @@ -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}; } }); diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 28019b26..88c9d08a 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -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() { diff --git a/js/views/key_verification_view.js b/js/views/key_verification_view.js index 66971ef9..1fbd966d 100644 --- a/js/views/key_verification_view.js +++ b/js/views/key_verification_view.js @@ -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) diff --git a/js/views/new_conversation_view.js b/js/views/new_conversation_view.js index 059b3084..43343669 100644 --- a/js/views/new_conversation_view.js +++ b/js/views/new_conversation_view.js @@ -46,7 +46,7 @@ this.$el.trigger('remove', {modelId: this.model.id}); this.remove(); }, - attributes: function() { + render_attributes: function() { return { name: this.model.getTitle() }; } }); diff --git a/js/views/whisper_view.js b/js/views/whisper_view.js index 9f49a1dc..dce3661c 100644 --- a/js/views/whisper_view.js +++ b/js/views/whisper_view.js @@ -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; diff --git a/test/views/whisper_view_test.js b/test/views/whisper_view_test.js index 0676a0b9..26296c09 100644 --- a/test/views/whisper_view_test.js +++ b/test/views/whisper_view_test.js @@ -1,8 +1,8 @@ describe('Whisper.View', function() { - it('renders a template with attributes', function() { + it('renders a template with render_attributes', function() { var viewClass = Whisper.View.extend({ template: '