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:
parent
0e0994832e
commit
77caa63321
12 changed files with 18 additions and 20 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue