|
|
@ -28,6 +28,12 @@
|
|
|
|
render_partials: function() {
|
|
|
|
render_partials: function() {
|
|
|
|
return Whisper.View.Templates;
|
|
|
|
return Whisper.View.Templates;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
template: function() {
|
|
|
|
|
|
|
|
if (this.templateName) {
|
|
|
|
|
|
|
|
return Whisper.View.Templates[this.templateName];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
},
|
|
|
|
render: function() {
|
|
|
|
render: function() {
|
|
|
|
var attrs = _.result(this, 'render_attributes', {});
|
|
|
|
var attrs = _.result(this, 'render_attributes', {});
|
|
|
|
var template = _.result(this, 'template', '');
|
|
|
|
var template = _.result(this, 'template', '');
|
|
|
@ -51,7 +57,7 @@
|
|
|
|
var templates = {};
|
|
|
|
var templates = {};
|
|
|
|
$('script[type="text/x-tmpl-mustache"]').each(function(i, el) {
|
|
|
|
$('script[type="text/x-tmpl-mustache"]').each(function(i, el) {
|
|
|
|
var $el = $(el);
|
|
|
|
var $el = $(el);
|
|
|
|
var id = $el.attr('id').replace('-','_');
|
|
|
|
var id = $el.attr('id');
|
|
|
|
templates[id] = $el.html();
|
|
|
|
templates[id] = $el.html();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return templates;
|
|
|
|
return templates;
|
|
|
|