mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #16 from sharelatex/as-prevent-hidden-autocompile
Prevent autocompile if PDF preview hidden
This commit is contained in:
commit
02d54d815f
2 changed files with 6 additions and 2 deletions
|
@ -71,11 +71,12 @@ define [
|
||||||
view: "editor"
|
view: "editor"
|
||||||
chatOpen: false
|
chatOpen: false
|
||||||
pdfLayout: 'sideBySide'
|
pdfLayout: 'sideBySide'
|
||||||
|
pdfHidden: false,
|
||||||
reviewPanelOpen: localStorage("ui.reviewPanelOpen.#{window.project_id}")
|
reviewPanelOpen: localStorage("ui.reviewPanelOpen.#{window.project_id}")
|
||||||
miniReviewPanelVisible: false
|
miniReviewPanelVisible: false
|
||||||
}
|
}
|
||||||
$scope.user = window.user
|
$scope.user = window.user
|
||||||
|
|
||||||
$scope.$watch "project.features.trackChangesVisible", (visible) ->
|
$scope.$watch "project.features.trackChangesVisible", (visible) ->
|
||||||
return if !visible?
|
return if !visible?
|
||||||
$scope.ui.showCollabFeaturesOnboarding = window.showTrackChangesOnboarding and visible
|
$scope.ui.showCollabFeaturesOnboarding = window.showTrackChangesOnboarding and visible
|
||||||
|
@ -99,6 +100,9 @@ define [
|
||||||
if value?
|
if value?
|
||||||
localStorage "ui.reviewPanelOpen.#{window.project_id}", value
|
localStorage "ui.reviewPanelOpen.#{window.project_id}", value
|
||||||
|
|
||||||
|
$scope.$on "layout:pdf:resize", (_, layoutState) ->
|
||||||
|
$scope.ui.pdfHidden = layoutState.east.initClosed
|
||||||
|
|
||||||
# Tracking code.
|
# Tracking code.
|
||||||
$scope.$watch "ui.view", (newView, oldView) ->
|
$scope.$watch "ui.view", (newView, oldView) ->
|
||||||
if newView? and newView != "editor" and newView != "pdf"
|
if newView? and newView != "editor" and newView != "pdf"
|
||||||
|
|
|
@ -77,7 +77,7 @@ define [
|
||||||
|
|
||||||
autoCompileTimeout = null
|
autoCompileTimeout = null
|
||||||
triggerAutoCompile = () ->
|
triggerAutoCompile = () ->
|
||||||
return if autoCompileTimeout
|
return if autoCompileTimeout or $scope.ui.pdfHidden
|
||||||
|
|
||||||
timeSinceLastCompile = Date.now() - $scope.recompiledAt
|
timeSinceLastCompile = Date.now() - $scope.recompiledAt
|
||||||
# If time is non-monotonic, assume that the user's system clock has been
|
# If time is non-monotonic, assume that the user's system clock has been
|
||||||
|
|
Loading…
Reference in a new issue