droppable.js 786 B

1234567891011121314151617181920212223242526
  1. /* eslint-disable
  2. no-undef,
  3. */
  4. // TODO: This file was created by bulk-decaffeinate.
  5. // Fix any style issues and re-enable lint.
  6. /*
  7. * decaffeinate suggestions:
  8. * DS102: Remove unnecessary code created because of implicit returns
  9. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  10. */
  11. define(['base'], App =>
  12. App.directive('droppable', () => ({
  13. link(scope, element, attrs) {
  14. return scope.$watch(attrs.droppable, function(droppable) {
  15. if (droppable) {
  16. return element.droppable({
  17. greedy: true,
  18. hoverClass: 'droppable-hover',
  19. tolerance: 'pointer',
  20. accept: attrs.accept,
  21. drop: scope.$eval(attrs.onDropCallback)
  22. })
  23. }
  24. })
  25. }
  26. })))