rightClick.js 622 B

123456789101112131415161718192021
  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('rightClick', () => ({
  13. restrict: 'A',
  14. link(scope, element, attrs) {
  15. return element.bind('contextmenu', function(e) {
  16. e.preventDefault()
  17. e.stopPropagation()
  18. return scope.$eval(attrs.rightClick)
  19. })
  20. }
  21. })))