Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class views.SlideShowView extends Backbone.View
- el: '.deck-container'
- constructor: (opts) ->
- super
- jade = require('jade')
- template = jade.compile $("#deck_template").html()
- @deckHTML = template()
- # Editor asks to update slides from parent window. This code is run in a iframe.
- $(window).bind "message", (e) =>
- data = e.originalEvent.data
- # Set html contents of the slideshow is set to a backbone model
- @model.set JSON.parse data
- # Render slides again always when we get a change.
- # Backbone automatically detects changes in models
- @model.bind "change", =>
- @render()
- render: ->
- # @el is body element
- $(@el).html @deckHTML
- $(@el).prepend @model.getHtml()
- $.deck(".slide")
Add Comment
Please, Sign In to add comment