draggable.js 689 B

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