mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-25 19:42:27 +00:00
16 lines
578 B
CoffeeScript
16 lines
578 B
CoffeeScript
define [
|
|
"base"
|
|
], (App) ->
|
|
App.controller "FileTreeRootFolderController", ["$scope", "ide", ($scope, ide) ->
|
|
rootFolder = $scope.rootFolder
|
|
$scope.onDrop = (events, ui) ->
|
|
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()
|
|
# clear highlight explicitly
|
|
$('.file-tree-inner .droppable-hover').removeClass('droppable-hover')
|
|
]
|