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

14 lines
450 B
CoffeeScript
Raw Normal View History

2014-07-03 06:01:41 -04:00
define [
"base"
], (App) ->
App.controller "FileTreeRootFolderController", ["$scope", "ide", ($scope, ide) ->
console.log "CREATING FileTreeRootFolderController"
rootFolder = $scope.rootFolder
console.log "ROOT FOLDER", rootFolder
$scope.onDrop = (events, ui) ->
source = $(ui.draggable).scope().entity
console.log "DROPPED INTO ROOT", source, rootFolder
return if !source?
ide.fileTreeManager.moveEntity(source, rootFolder)
]