diff --git a/core/admin/assets/js/views/blog.js b/core/admin/assets/js/views/blog.js index bd159ee929..b64deab52f 100644 --- a/core/admin/assets/js/views/blog.js +++ b/core/admin/assets/js/views/blog.js @@ -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) { diff --git a/core/admin/assets/js/views/dashboard.js b/core/admin/assets/js/views/dashboard.js index 568c329546..ace0f4a6ba 100644 --- a/core/admin/assets/js/views/dashboard.js +++ b/core/admin/assets/js/views/dashboard.js @@ -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; }