2014-07-03 06:01:41 -04:00
|
|
|
define [
|
|
|
|
"base"
|
|
|
|
], (App) ->
|
|
|
|
App.controller "FileTreeRootFolderController", ["$scope", "ide", ($scope, ide) ->
|
|
|
|
rootFolder = $scope.rootFolder
|
|
|
|
$scope.onDrop = (events, ui) ->
|
2016-02-09 10:13:58 -05:00
|
|
|
if ide.fileTreeManager.multiSelectedCount()
|
|
|
|
entities = ide.fileTreeManager.getMultiSelectedEntityChildNodes()
|
|
|
|
else
|
|
|
|
entities = [$(ui.draggable).scope().entity]
|
|
|
|
for dropped_entity in entities
|
|
|
|
ide.fileTreeManager.moveEntity(dropped_entity, rootFolder)
|
|
|
|
$scope.$digest()
|
2016-02-10 10:54:25 -05:00
|
|
|
# clear highlight explicitly
|
|
|
|
$('.file-tree-inner .droppable-hover').removeClass('droppable-hover')
|
2014-07-03 06:01:41 -04:00
|
|
|
]
|