overleaf/services/web/public/coffee/ide/file-tree/controllers/FileTreeRootFolderController.coffee

17 lines
578 B
CoffeeScript
Raw Normal View History

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) ->
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')
2014-07-03 10:01:41 +00:00
]