rightClick.js 586 B

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