draggable.js 729 B

12345678910111213141516171819202122232425
  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('draggable', () => ({
  13. link(scope, element, attrs) {
  14. return scope.$watch(attrs.draggable, function(draggable) {
  15. if (draggable) {
  16. return element.draggable({
  17. delay: 250,
  18. opacity: 0.95,
  19. scroll: true,
  20. helper: scope.$eval(attrs.draggableHelper)
  21. })
  22. }
  23. })
  24. }
  25. })))