stopPropagation.js 757 B

1234567891011121314151617181920212223242526
  1. /* eslint-disable
  2. max-len,
  3. no-undef,
  4. */
  5. // TODO: This file was created by bulk-decaffeinate.
  6. // Fix any style issues and re-enable lint.
  7. /*
  8. * decaffeinate suggestions:
  9. * DS102: Remove unnecessary code created because of implicit returns
  10. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  11. */
  12. define(['base'], function(App) {
  13. App.directive('stopPropagation', $http => ({
  14. restrict: 'A',
  15. link(scope, element, attrs) {
  16. return element.bind(attrs.stopPropagation, e => e.stopPropagation())
  17. }
  18. }))
  19. return App.directive('preventDefault', $http => ({
  20. restrict: 'A',
  21. link(scope, element, attrs) {
  22. return element.bind(attrs.preventDefault, e => e.preventDefault())
  23. }
  24. }))
  25. })