mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Components can now be added to thangs by dragging and dropping
This commit is contained in:
parent
ca7b8ca10a
commit
03d696c3df
1 changed files with 10 additions and 0 deletions
|
@ -39,6 +39,10 @@ module.exports = class ThangComponentEditView extends CocoView
|
|||
|
||||
@extantComponentsTreema = @$el.find('#extant-components-column .treema').treema treemaOptions
|
||||
@extantComponentsTreema.build()
|
||||
@$el.find('#extant-components-column .treema').droppable({
|
||||
drop: =>
|
||||
@onAddComponentEnterPressed @selectedRow
|
||||
})
|
||||
|
||||
buildAddComponentTreema: ->
|
||||
return unless @componentCollection and @extantComponentsTreema
|
||||
|
@ -65,6 +69,12 @@ module.exports = class ThangComponentEditView extends CocoView
|
|||
_.defer (=>
|
||||
@addComponentsTreema = @$el.find('#add-component-column .treema').treema treemaOptions
|
||||
@addComponentsTreema.build()
|
||||
@$el.find('#add-component-column .treema-node').draggable({
|
||||
revert: true
|
||||
start: (e) ->
|
||||
# Hack to ensure dragged treema node is selected
|
||||
$(@).trigger('click') unless $(@).hasClass 'treema-selected'
|
||||
})
|
||||
@hideLoading()
|
||||
), 500
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue