spellMenu.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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'], App =>
  13. App.component('spellMenu', {
  14. bindings: {
  15. open: '<',
  16. top: '<',
  17. left: '<',
  18. layoutFromBottom: '<',
  19. highlight: '<',
  20. replaceWord: '&',
  21. learnWord: '&'
  22. },
  23. template: `\
  24. <div
  25. class="dropdown context-menu spell-check-menu"
  26. ng-show="$ctrl.open"
  27. ng-style="{top: $ctrl.top, left: $ctrl.left}"
  28. ng-class="{open: $ctrl.open, 'spell-check-menu-from-bottom': $ctrl.layoutFromBottom}"
  29. >
  30. <ul class="dropdown-menu">
  31. <li ng-repeat="suggestion in $ctrl.highlight.suggestions | limitTo:8">
  32. <a
  33. href
  34. ng-click="$ctrl.replaceWord({ highlight: $ctrl.highlight, suggestion: suggestion })"
  35. >
  36. {{ suggestion }}
  37. </a>
  38. </li>
  39. <li class="divider"></li>
  40. <li>
  41. <a href ng-click="$ctrl.learnWord({ highlight: $ctrl.highlight })">Add to Dictionary</a>
  42. </li>
  43. </ul>
  44. </div>\
  45. `
  46. }))