Sha256: ff78f3a0376b6f14e7007bd13f8f51be5b44688e1fc2d2498da5aac19ba6fda9

Contents?: true

Size: 632 Bytes

Versions: 19

Compression:

Stored size: 632 Bytes

Contents

Luca.components.Template = Luca.View.extend
  initialize: (@options={})->
    Luca.View::initialize.apply @, arguments
    throw "Templates must specify which template / markup to use" unless @template or @markup

    if _.isString(@templateContainer)
      @templateContainer = eval("(window || global).#{ @templateContainer }")

  templateContainer: "Luca.templates"

  beforeRender: ()->
    @templateContainer = JST if _.isUndefined( @templateContainer) 
    @$el.html(@markup || @templateContainer[ @template ](@options) )

  render: ()->
    $(@container).append( @$el )


Luca.register "template", "Luca.components.Template"

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
luca-0.8.3 src/components/template.coffee
luca-0.8.2 src/components/template.coffee
luca-0.8.06 src/components/template.coffee
luca-0.8 src/components/template.coffee
luca-0.7.92 src/components/template.coffee
luca-0.7.91 src/components/template.coffee
luca-0.7.9 src/components/template.coffee
luca-0.7.8 src/components/template.coffee
luca-0.7.7 src/components/template.coffee
luca-0.7.6 src/components/template.coffee
luca-0.7.5 src/components/template.coffee
luca-0.7.4 src/components/template.coffee
luca-0.7.3 src/components/template.coffee
luca-0.7.2 src/components/template.coffee
luca-0.7.0 src/components/template.coffee
luca-0.6.9 src/components/template.coffee
luca-0.6.8 src/components/template.coffee
luca-0.6.7 src/components/template.coffee
luca-0.6.6 src/components/template.coffee