mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 18:29:37 -05:00
5465aef099
Update file outline to follow React code style guidelines GitOrigin-RevId: 8b32e27d20378cbf573d24feb799eb6f99746402
33 lines
1,018 B
JavaScript
33 lines
1,018 B
JavaScript
import App from '../../../base'
|
|
import OutlinePane from '../components/outline-pane'
|
|
import { react2angular } from 'react2angular'
|
|
|
|
App.controller('OutlineController', function($scope, ide, eventTracking) {
|
|
$scope.isTexFile = false
|
|
$scope.outline = []
|
|
$scope.eventTracking = eventTracking
|
|
|
|
$scope.$on('outline-manager:outline-changed', onOutlineChange)
|
|
|
|
function onOutlineChange(e, outlineInfo) {
|
|
$scope.$applyAsync(() => {
|
|
$scope.isTexFile = outlineInfo.isTexFile
|
|
$scope.outline = outlineInfo.outline
|
|
$scope.highlightedLine = outlineInfo.highlightedLine
|
|
})
|
|
}
|
|
|
|
$scope.jumpToLine = (lineNo, syncToPdf) => {
|
|
ide.outlineManager.jumpToLine(lineNo, syncToPdf)
|
|
eventTracking.sendMB('outline-jump-to-line')
|
|
}
|
|
|
|
$scope.onToggle = isOpen => {
|
|
$scope.$applyAsync(() => {
|
|
$scope.$emit('outline-toggled', isOpen)
|
|
})
|
|
}
|
|
})
|
|
|
|
// Wrap React component as Angular component. Only needed for "top-level" component
|
|
App.component('outlinePane', react2angular(OutlinePane))
|