overleaf/services/web/public/coffee/ide/pdfng/controllers/PdfViewToggleController.coffee

17 lines
417 B
CoffeeScript
Raw Normal View History

2014-11-25 16:00:21 +00:00
define [
"base"
], (App) ->
App.controller "PdfViewToggleController", ($scope) ->
$scope.togglePdfView = () ->
if $scope.ui.view == "pdf"
$scope.ui.view = "editor"
else
$scope.ui.view = "pdf"
$scope.fileTreeClosed = false
$scope.$on "layout:main:resize", (e, state) ->
if state.west.initClosed
$scope.fileTreeClosed = true
else
$scope.fileTreeClosed = false
$scope.$apply()