|
|
@@ -4,7 +4,7 @@ define [
|
|
|
], (App, LogParser) ->
|
|
|
App.controller "PdfController", ["$scope", "$http", "ide", "$modal", "synctex", ($scope, $http, ide, $modal, synctex) ->
|
|
|
autoCompile = true
|
|
|
- $scope.$on "doc:opened", () ->
|
|
|
+ $scope.$on "project:joined", () ->
|
|
|
return if !autoCompile
|
|
|
autoCompile = false
|
|
|
$scope.recompile(isAutoCompile: true)
|
|
|
@@ -147,7 +147,22 @@ define [
|
|
|
.then (data) ->
|
|
|
{doc, line} = data
|
|
|
ide.editorManager.openDoc(doc, gotoLine: line)
|
|
|
-
|
|
|
+
|
|
|
+ $scope.switchToFlatLayout = () ->
|
|
|
+ $scope.ui.pdfLayout = 'flat'
|
|
|
+ $scope.ui.view = 'pdf'
|
|
|
+ $.localStorage "pdf.layout", "flat"
|
|
|
+
|
|
|
+ $scope.switchToSideBySideLayout = () ->
|
|
|
+ $scope.ui.pdfLayout = 'sideBySide'
|
|
|
+ $scope.ui.view = 'editor'
|
|
|
+ $.localStorage "pdf.layout", "split"
|
|
|
+
|
|
|
+ if pdfLayout = $.localStorage("pdf.layout")
|
|
|
+ $scope.switchToSideBySideLayout() if pdfLayout == "split"
|
|
|
+ $scope.switchToFlatLayout() if pdfLayout == "flat"
|
|
|
+ else
|
|
|
+ $scope.switchToSideBySideLayout()
|
|
|
]
|
|
|
|
|
|
App.factory "synctex", ["ide", "$http", "$q", (ide, $http, $q) ->
|