overleaf/services/web/public/coffee/ide/file-tree/directives/droppable.coffee
2014-07-21 11:36:03 +01:00

14 lines
No EOL
336 B
CoffeeScript

define [
"base"
], (App) ->
App.directive "droppable", () ->
return {
link: (scope, element, attrs) ->
scope.$watch attrs.droppable, (droppable) ->
if droppable
element.droppable
greedy: true
hoverClass: "droppable-hover"
accept: attrs.accept
drop: scope.$eval(attrs.onDropCallback)
}