Skip to content

Instantly share code, notes, and snippets.

@jackjennings
Created September 15, 2014 23:18
Show Gist options
  • Save jackjennings/3940706d71ffc43a5d51 to your computer and use it in GitHub Desktop.
Save jackjennings/3940706d71ffc43a5d51 to your computer and use it in GitHub Desktop.
st-basic-block
BasicBlock = SirTrevor.Block.extend
template: _.template("""
<header>
<div class='title'><%= title %></div>
</header>
""")
initialize: ->
@$el.addClass 'st-embed'
@$el.addClass 'st-embed-' + @type
loadData: (data) ->
@data = _(data).defaults(@defaults or {})
toData: ->
@setData @data
onBlockRender: ->
@$editor.html @template title: @title?() or @title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment