codecombat/app/views/editor_view.coffee

20 lines
591 B
CoffeeScript
Raw Normal View History

2014-01-03 13:32:13 -05:00
View = require 'views/kinds/RootView'
template = require 'templates/editor'
module.exports = class EditorView extends View
id: "editor-level-view"
template: template
events:
"click .images img": "onClickImage"
"click #image-modal": "onClickImageModal"
onClickImage: (e) =>
imgURL = $(e.target).attr('src')
img = $('<img></img>').attr('src', imgURL)
img.addClass('img-polaroid')
@$el.find('#image-modal .modal-body').empty().append(img)
@$el.find('#image-modal').modal('show')
onClickImageModal: (e) =>
@$el.find('#image-modal').modal('hide')