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

14 lines
336 B
CoffeeScript
Raw Normal View History

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