mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
f9bda25072
Remove $scope.$broadcast('open') from React controllers GitOrigin-RevId: 40780c373e14c4dbbd921460638bcb4616f34c86
37 lines
880 B
JavaScript
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
|
|
}
|
|
})
|
|
}
|
|
}
|
|
)
|