2018-11-05 05:06:39 -05:00
|
|
|
/* eslint-disable
|
|
|
|
max-len,
|
|
|
|
*/
|
|
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
|
|
// Fix any style issues and re-enable lint.
|
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
2020-05-19 05:02:56 -04:00
|
|
|
import App from '../../../base'
|
|
|
|
|
|
|
|
export default App.component('spellMenu', {
|
|
|
|
bindings: {
|
|
|
|
open: '<',
|
|
|
|
top: '<',
|
|
|
|
left: '<',
|
|
|
|
layoutFromBottom: '<',
|
|
|
|
highlight: '<',
|
|
|
|
replaceWord: '&',
|
2021-04-27 03:52:58 -04:00
|
|
|
learnWord: '&',
|
2020-05-19 05:02:56 -04:00
|
|
|
},
|
|
|
|
template: `\
|
2018-11-05 05:06:39 -05:00
|
|
|
<div
|
2020-05-19 05:02:56 -04:00
|
|
|
class="dropdown context-menu spell-check-menu"
|
|
|
|
ng-show="$ctrl.open"
|
|
|
|
ng-style="{top: $ctrl.top, left: $ctrl.left}"
|
|
|
|
ng-class="{open: $ctrl.open, 'spell-check-menu-from-bottom': $ctrl.layoutFromBottom}"
|
2018-11-05 05:06:39 -05:00
|
|
|
>
|
2020-05-19 05:02:56 -04:00
|
|
|
<ul class="dropdown-menu">
|
|
|
|
<li ng-repeat="suggestion in $ctrl.highlight.suggestions | limitTo:8">
|
2022-01-19 05:41:36 -05:00
|
|
|
<button
|
|
|
|
class="btn-link text-left dropdown-menu-button"
|
2020-05-19 05:02:56 -04:00
|
|
|
ng-click="$ctrl.replaceWord({ highlight: $ctrl.highlight, suggestion: suggestion })"
|
|
|
|
>
|
|
|
|
{{ suggestion }}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="divider"></li>
|
|
|
|
<li>
|
|
|
|
<a href ng-click="$ctrl.learnWord({ highlight: $ctrl.highlight })">Add to Dictionary</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2018-11-05 05:06:39 -05:00
|
|
|
</div>\
|
2021-04-27 03:52:58 -04:00
|
|
|
`,
|
2020-05-19 05:02:56 -04:00
|
|
|
})
|