Make it easier to reference templates

Whisper.Views can now use templateName to reference the id of the
desired template.
This commit is contained in:
lilia 2015-09-04 13:06:17 -07:00
parent 239b87a1fa
commit e402338af7
4 changed files with 11 additions and 5 deletions

View file

@ -38,7 +38,7 @@
events: {
'click .remove': 'removeModel'
},
template: $('#contact_pill').html(),
templateName: 'contact_pill',
initialize: function() {
var error = this.model.validate(this.model.attributes);
if (error) {
@ -60,7 +60,7 @@
Whisper.RecipientsInputView = Whisper.View.extend({
className: 'recipients-input',
template: $('#recipients-input').html(),
templateName: 'recipients-input',
initialize: function(options) {
if (options) {
this.placeholder = options.placeholder;