Sha256: 918065782f6633500d4cd3edb496f25da2d2d5e7bfd6dfba5f3f01a7ee475a4b
Contents?: true
Size: 908 Bytes
Versions: 30
Compression:
Stored size: 908 Bytes
Contents
(function() { Luca.components.Template = Luca.View.extend({ initialize: function(options) { this.options = options != null ? options : {}; Luca.View.prototype.initialize.apply(this, arguments); if (!(this.template || this.markup)) { throw "Templates must specify which template / markup to use"; } if (_.isString(this.templateContainer)) { return this.templateContainer = eval("(window || global)." + this.templateContainer); } }, templateContainer: "Luca.templates", beforeRender: function() { if (_.isUndefined(this.templateContainer)) this.templateContainer = JST; return this.$el.html(this.markup || this.templateContainer[this.template](this.options)); }, render: function() { return $(this.container).append(this.$el); } }); Luca.register("template", "Luca.components.Template"); }).call(this);
Version data entries
30 entries across 30 versions & 1 rubygems