draggable.js 710 B

12345678910111213141516171819202122232425
  1. /* eslint-disable
  2. */
  3. // TODO: This file was created by bulk-decaffeinate.
  4. // Fix any style issues and re-enable lint.
  5. /*
  6. * decaffeinate suggestions:
  7. * DS102: Remove unnecessary code created because of implicit returns
  8. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  9. */
  10. import App from '../../../base'
  11. export default App.directive('draggable', () => ({
  12. link(scope, element, attrs) {
  13. return scope.$watch(attrs.draggable, function(draggable) {
  14. if (draggable) {
  15. return element.draggable({
  16. delay: 250,
  17. opacity: 0.95,
  18. scroll: true,
  19. helper: scope.$eval(attrs.draggableHelper)
  20. })
  21. }
  22. })
  23. }
  24. }))