Merge pull request #16 from sharelatex/as-prevent-hidden-autocompile

Prevent autocompile if PDF preview hidden
This commit is contained in:
Hayden Faulds 2017-09-26 15:38:31 +01:00 committed by GitHub
commit 02d54d815f
2 changed files with 6 additions and 2 deletions

View file

@ -71,6 +71,7 @@ define [
view: "editor"
chatOpen: false
pdfLayout: 'sideBySide'
pdfHidden: false,
reviewPanelOpen: localStorage("ui.reviewPanelOpen.#{window.project_id}")
miniReviewPanelVisible: false
}
@ -99,6 +100,9 @@ define [
if value?
localStorage "ui.reviewPanelOpen.#{window.project_id}", value
$scope.$on "layout:pdf:resize", (_, layoutState) ->
$scope.ui.pdfHidden = layoutState.east.initClosed
# Tracking code.
$scope.$watch "ui.view", (newView, oldView) ->
if newView? and newView != "editor" and newView != "pdf"

View file

@ -77,7 +77,7 @@ define [
autoCompileTimeout = null
triggerAutoCompile = () ->
return if autoCompileTimeout
return if autoCompileTimeout or $scope.ui.pdfHidden
timeSinceLastCompile = Date.now() - $scope.recompiledAt
# If time is non-monotonic, assume that the user's system clock has been