overleaf/services/web/public/coffee/ide/file-tree/directives/droppable.coffee

15 lines
364 B
CoffeeScript
Raw Normal View History

2014-07-08 07:02:26 -04:00
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"
tolerance: "pointer"
2014-07-08 07:02:26 -04:00
accept: attrs.accept
2014-07-21 06:36:03 -04:00
drop: scope.$eval(attrs.onDropCallback)
2014-07-08 07:02:26 -04:00
}