overleaf/services/web/frontend/js/features/clone-project-modal/controllers/left-menu-clone-project-modal-controller.js
Alf Eaton 69482d9d3c Refactor Clone Project modal (#4748)
GitOrigin-RevId: 03f5164d117713efd78c9806bdda6e6d5c90f6dc
2021-09-15 08:03:33 +00:00

35 lines
812 B
JavaScript

import App from '../../../base'
import { react2angular } from 'react2angular'
import CloneProjectModal from '../components/clone-project-modal'
import { rootContext } from '../../../shared/context/root-context'
export default App.controller(
'LeftMenuCloneProjectModalController',
function ($scope) {
$scope.show = false
$scope.handleHide = () => {
$scope.$applyAsync(() => {
$scope.show = false
})
}
$scope.openCloneProjectModal = () => {
$scope.$applyAsync(() => {
$scope.show = true
})
}
$scope.openProject = projectId => {
window.location.assign(`/project/${projectId}`)
}
}
)
App.component(
'cloneProjectModal',
react2angular(
rootContext.use(CloneProjectModal),
Object.keys(CloneProjectModal.propTypes)
)
)