overleaf/services/web/frontend/js/features/clone-project-modal/controllers/left-menu-clone-project-modal-controller.js
Alf Eaton f9bda25072 Merge pull request #3921 from overleaf/ae-remove-broadcast-open
Remove $scope.$broadcast('open') from React controllers

GitOrigin-RevId: 40780c373e14c4dbbd921460638bcb4616f34c86
2021-04-22 02:09:34 +00:00

37 lines
880 B
JavaScript

import App from '../../../base'
import { react2angular } from 'react2angular'
import CloneProjectModal from '../components/clone-project-modal'
App.component('cloneProjectModal', react2angular(CloneProjectModal))
export default App.controller(
'LeftMenuCloneProjectModalController',
function ($scope, ide) {
$scope.show = false
$scope.projectId = ide.$scope.project_id
$scope.handleHide = () => {
$scope.$applyAsync(() => {
$scope.show = false
})
}
$scope.openProject = projectId => {
window.location.assign(`/project/${projectId}`)
}
$scope.openCloneProjectModal = () => {
$scope.$applyAsync(() => {
const { project } = ide.$scope
if (project) {
$scope.projectId = project._id
$scope.projectName = project.name
$scope.show = true
}
})
}
}
)