overleaf/services/web/frontend/js/features/dictionary/controllers/modal-controller.js
Miguel Serrano 430b7528b2 Merge pull request #8073 from overleaf/ta-td-dictionary
Add UI to Remove Words from Dictionary

GitOrigin-RevId: a28d865e3c968d6fff113237fcf4143b77af046e
2022-05-25 08:09:45 +00:00

26 lines
686 B
JavaScript

import App from '../../../base'
import { react2angular } from 'react2angular'
import DictionaryModal from '../components/dictionary-modal'
import { rootContext } from '../../../shared/context/root-context'
export default App.controller('DictionaryModalController', function ($scope) {
$scope.show = false
$scope.handleHide = () => {
$scope.$applyAsync(() => {
$scope.show = false
window.dispatchEvent(new CustomEvent('learnedWords:reset'))
})
}
$scope.openModal = () => {
$scope.$applyAsync(() => {
$scope.show = true
})
}
})
App.component(
'dictionaryModal',
react2angular(rootContext.use(DictionaryModal), ['show', 'handleHide'])
)