mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Extract timeout constant
This commit is contained in:
parent
a9e94f6a6d
commit
ce630e4971
1 changed files with 3 additions and 1 deletions
|
@ -5,6 +5,8 @@ define [
|
||||||
"libs/bib-log-parser"
|
"libs/bib-log-parser"
|
||||||
"services/log-hints-feedback"
|
"services/log-hints-feedback"
|
||||||
], (App, Ace, HumanReadableLogs, BibLogParser) ->
|
], (App, Ace, HumanReadableLogs, BibLogParser) ->
|
||||||
|
AUTO_COMPILE_TIMEOUT = 3000
|
||||||
|
|
||||||
App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, logHintsFeedback, localStorage) ->
|
App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, logHintsFeedback, localStorage) ->
|
||||||
# enable per-user containers by default
|
# enable per-user containers by default
|
||||||
perUserCompile = true
|
perUserCompile = true
|
||||||
|
@ -79,7 +81,7 @@ define [
|
||||||
autoCompileListener = null
|
autoCompileListener = null
|
||||||
toggleAutoCompile = (enabling) ->
|
toggleAutoCompile = (enabling) ->
|
||||||
if enabling
|
if enabling
|
||||||
autoCompileListener = ide.$scope.$on "ide:opAcknowledged", _.debounce(triggerAutoCompile, 3000)
|
autoCompileListener = ide.$scope.$on "ide:opAcknowledged", _.debounce(triggerAutoCompile, AUTO_COMPILE_TIMEOUT)
|
||||||
else
|
else
|
||||||
autoCompileListener() if autoCompileListener
|
autoCompileListener() if autoCompileListener
|
||||||
autoCompileListener = null
|
autoCompileListener = null
|
||||||
|
|
Loading…
Reference in a new issue