mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-27 14:44:08 +00:00
17 lines
364 B
CoffeeScript
17 lines
364 B
CoffeeScript
|
define [
|
||
|
"base"
|
||
|
], (App) ->
|
||
|
App.directive "droppable", () ->
|
||
|
return {
|
||
|
scope: {
|
||
|
onDropCallback: "="
|
||
|
}
|
||
|
link: (scope, element, attrs) ->
|
||
|
scope.$watch attrs.droppable, (droppable) ->
|
||
|
if droppable
|
||
|
element.droppable
|
||
|
greedy: true
|
||
|
hoverClass: "droppable-hover"
|
||
|
accept: attrs.accept
|
||
|
drop: scope.onDropCallback
|
||
|
}
|