mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 23:05:56 -05:00
27 lines
686 B
JavaScript
27 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'])
|
||
|
)
|