2014-07-03 10:01:41 +00:00
|
|
|
define [
|
|
|
|
"base"
|
|
|
|
], (App) ->
|
|
|
|
App.controller "FileTreeRootFolderController", ["$scope", "ide", ($scope, ide) ->
|
|
|
|
rootFolder = $scope.rootFolder
|
|
|
|
$scope.onDrop = (events, ui) ->
|
2016-02-09 15:13:58 +00: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 15:54:25 +00:00
|
|
|
# clear highlight explicitly
|
|
|
|
$('.file-tree-inner .droppable-hover').removeClass('droppable-hover')
|
2014-07-03 10:01:41 +00:00
|
|
|
]
|