mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
f375362894
* Always use mockable location methods * Add eslint rules for window.location calls/assignment * Add useLocation hook * Update tests GitOrigin-RevId: eafb846db89f884a7a9a8570cce7745be605152c
36 lines
918 B
JavaScript
36 lines
918 B
JavaScript
import App from '../../../base'
|
|
import { react2angular } from 'react2angular'
|
|
import EditorCloneProjectModalWrapper from '../components/editor-clone-project-modal-wrapper'
|
|
import { rootContext } from '../../../shared/context/root-context'
|
|
import { assign } from '../../../shared/components/location'
|
|
|
|
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 = project => {
|
|
assign(`/project/${project.project_id}`)
|
|
}
|
|
}
|
|
)
|
|
|
|
App.component(
|
|
'cloneProjectModal',
|
|
react2angular(
|
|
rootContext.use(EditorCloneProjectModalWrapper),
|
|
Object.keys(EditorCloneProjectModalWrapper.propTypes)
|
|
)
|
|
)
|