mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 04:13:30 +03:00
Merge pull request #191 from matthojo/template-moving
Updated reference to templates in Backbone views
This commit is contained in:
commit
b7c1ed2aef
@ -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