spellMenu.js 1.2 KB

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