overleaf/services/web/frontend/js/features/binary-file/controllers/binary-file-controller.js
Jakob Ackermann 3f1ae7bff2 Merge pull request #4044 from overleaf/as-file-views-text-extension
Pull text extension list from settings, instead of hard-coding it

GitOrigin-RevId: b5ba956b8f065b852a2f5efc1a775ccb70df3226
2021-05-22 02:05:53 +00:00

22 lines
559 B
JavaScript

import App from '../../../base'
import { react2angular } from 'react2angular'
import _ from 'lodash'
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(BinaryFile, ['storeReferencesKeys', 'file'])
)