mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
20 lines
591 B
CoffeeScript
20 lines
591 B
CoffeeScript
|
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')
|