Normalize views' template fetching pattern
Typically, a view can specify its templateName and then use the default render method on Whisper.View, except in some special cases like message view or message detail where other operations are performed during render. // FREEBIE
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
Whisper.PhoneInputView = Whisper.View.extend({
|
||||
tagName: 'div',
|
||||
className: 'phone-input',
|
||||
template: $('#phone-number').html(),
|
||||
templateName: 'phone-number',
|
||||
render: function() {
|
||||
this.$el.html($(Mustache.render(this.template)));
|
||||
this.$('input.number').intlTelInput();
|
||||
|
Reference in New Issue
Block a user