mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05: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')
|
|
]
|