mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-03 14:03:37 -05:00
Add autocompile setting
This commit is contained in:
parent
64f70942d0
commit
cca7f55322
2 changed files with 16 additions and 1 deletions
|
@ -26,6 +26,15 @@ div.full-size.pdf(ng-controller="PdfController")
|
|||
)
|
||||
span.caret
|
||||
ul.dropdown-menu.dropdown-menu-left
|
||||
// Only show on beta program?
|
||||
li.dropdown-header Auto-compile
|
||||
li
|
||||
a(href, ng-click="autocompile_enabled = true")
|
||||
i.fa.fa-fw(ng-class="{'fa-check': autocompile_enabled}")
|
||||
| On
|
||||
a(href, ng-click="autocompile_enabled = false")
|
||||
i.fa.fa-fw(ng-class="{'fa-check': !autocompile_enabled}")
|
||||
| Off
|
||||
li.dropdown-header #{translate("compile_mode")}
|
||||
li
|
||||
a(href, ng-click="draft = false")
|
||||
|
|
|
@ -72,10 +72,16 @@ define [
|
|||
$scope.pdf.view = 'errors'
|
||||
$scope.pdf.renderingError = true
|
||||
|
||||
$scope.autocompile_enabled = localStorage("autocompile_enabled:#{$scope.project_id}") or false
|
||||
$scope.$watch "autocompile_enabled", (newValue, oldValue) ->
|
||||
if newValue? and oldValue != newValue
|
||||
localStorage("autocompile_enabled:#{$scope.project_id}", newValue)
|
||||
|
||||
# TODO: toggle listener when setting changed?
|
||||
ide.$scope.$on "ide:opAcknowledged", _.debounce(() ->
|
||||
if (!ide.$scope.hasLintingError)
|
||||
$scope.recompile()
|
||||
, 3000) if window.user?.betaProgram
|
||||
, 3000) if window.user?.betaProgram and $scope.autocompile_enabled
|
||||
|
||||
# abort compile if syntax checks fail
|
||||
$scope.stop_on_validation_error = localStorage("stop_on_validation_error:#{$scope.project_id}")
|
||||
|
|
Loading…
Reference in a new issue