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 = @$el.find('#extant-components-column .treema').treema treemaOptions
|
||||||
@extantComponentsTreema.build()
|
@extantComponentsTreema.build()
|
||||||
|
@$el.find('#extant-components-column .treema').droppable({
|
||||||
|
drop: =>
|
||||||
|
@onAddComponentEnterPressed @selectedRow
|
||||||
|
})
|
||||||
|
|
||||||
buildAddComponentTreema: ->
|
buildAddComponentTreema: ->
|
||||||
return unless @componentCollection and @extantComponentsTreema
|
return unless @componentCollection and @extantComponentsTreema
|
||||||
|
@ -65,6 +69,12 @@ module.exports = class ThangComponentEditView extends CocoView
|
||||||
_.defer (=>
|
_.defer (=>
|
||||||
@addComponentsTreema = @$el.find('#add-component-column .treema').treema treemaOptions
|
@addComponentsTreema = @$el.find('#add-component-column .treema').treema treemaOptions
|
||||||
@addComponentsTreema.build()
|
@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()
|
@hideLoading()
|
||||||
), 500
|
), 500
|
||||||
|
|
||||||
|
|
Reference in a new issue