rightClick.js 605 B

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