2018-11-05 10:06:39 +00: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 09:02:56 +00:00
|
|
|
import App from '../../../base'
|
|
|
|
|
|
|
|
export default App.component('spellMenu', {
|
|
|
|
bindings: {
|
|
|
|
open: '<',
|
|
|
|
top: '<',
|
|
|
|
left: '<',
|
|
|
|
layoutFromBottom: '<',
|
|
|
|
highlight: '<',
|
|
|
|
replaceWord: '&',
|
2021-04-27 07:52:58 +00:00
|
|
|
learnWord: '&',
|
2020-05-19 09:02:56 +00:00
|
|
|
},
|
|
|
|
template: `\
|
2018-11-05 10:06:39 +00:00
|
|
|
<div
|
2020-05-19 09:02:56 +00: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 10:06:39 +00:00
|
|
|
>
|
2020-05-19 09:02:56 +00:00
|
|
|
<ul class="dropdown-menu">
|
|
|
|
<li ng-repeat="suggestion in $ctrl.highlight.suggestions | limitTo:8">
|
|
|
|
<a
|
|
|
|
href
|
|
|
|
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 10:06:39 +00:00
|
|
|
</div>\
|
2021-04-27 07:52:58 +00:00
|
|
|
`,
|
2020-05-19 09:02:56 +00:00
|
|
|
})
|