mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +03:00
Updated reference to templates in Backbone views
This commit is contained in:
parent
2621de54a0
commit
23d317ed3e
@ -109,7 +109,11 @@
|
||||
Backbone.trigger('blog:activeItem', item.data('id'));
|
||||
},
|
||||
|
||||
template: JST['content/list-item'],
|
||||
templateName: "list-item",
|
||||
|
||||
template: function (data) {
|
||||
return JST[this.templateName](data);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.$el.html(this.template(_.extend({active: this.active}, this.model.toJSON())));
|
||||
@ -157,7 +161,11 @@
|
||||
window.location = '/ghost/editor/' + this.model.get('id');
|
||||
},
|
||||
|
||||
template: JST['content/preview'],
|
||||
templateName: "preview",
|
||||
|
||||
template: function (data) {
|
||||
return JST[this.templateName](data);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
if (this.activeId) {
|
||||
|
@ -139,7 +139,11 @@
|
||||
this.render();
|
||||
},
|
||||
|
||||
template: JST['content/widget'],
|
||||
templateName: "widget",
|
||||
|
||||
template: function (data) {
|
||||
return JST[this.templateName](data);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.$el.html(this.template(this.model.toJSON()));
|
||||
@ -155,12 +159,11 @@
|
||||
// ----------
|
||||
WidgetContent = Ghost.View.extend({
|
||||
|
||||
getTemplate: function () {
|
||||
return JST['content/widgets/' + this.model.attributes.content.template];
|
||||
template: function (data) {
|
||||
return JST['widgets/' + this.model.attributes.content.template](data);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.template = this.getTemplate();
|
||||
this.$el.html(this.template(this.model.toJSON()));
|
||||
return this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user