mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-11 21:32:21 -05:00
8f0a0439cd
Pull project id from `EditorContext` instead of `window` in file views GitOrigin-RevId: 78c2686d8bcd1e95414631ca77143fd9ae3edbc6
23 lines
643 B
JavaScript
23 lines
643 B
JavaScript
import App from '../../../base'
|
|
import { react2angular } from 'react2angular'
|
|
import _ from 'lodash'
|
|
|
|
import { rootContext } from '../../../shared/context/root-context'
|
|
import BinaryFile from '../components/binary-file'
|
|
|
|
export default App.controller(
|
|
'ReactBinaryFileController',
|
|
function ($scope, $rootScope) {
|
|
$scope.file = $scope.openFile
|
|
|
|
$scope.storeReferencesKeys = newKeys => {
|
|
const oldKeys = $rootScope._references.keys
|
|
return ($rootScope._references.keys = _.union(oldKeys, newKeys))
|
|
}
|
|
}
|
|
)
|
|
|
|
App.component(
|
|
'binaryFile',
|
|
react2angular(rootContext.use(BinaryFile), ['storeReferencesKeys', 'file'])
|
|
)
|