Extract timeout constant

This commit is contained in:
Alasdair Smith 2017-09-05 14:00:14 +01:00
parent a9e94f6a6d
commit ce630e4971

View file

@ -5,6 +5,8 @@ define [
"libs/bib-log-parser"
"services/log-hints-feedback"
], (App, Ace, HumanReadableLogs, BibLogParser) ->
AUTO_COMPILE_TIMEOUT = 3000
App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, logHintsFeedback, localStorage) ->
# enable per-user containers by default
perUserCompile = true
@ -79,7 +81,7 @@ define [
autoCompileListener = null
toggleAutoCompile = (enabling) ->
if enabling
autoCompileListener = ide.$scope.$on "ide:opAcknowledged", _.debounce(triggerAutoCompile, 3000)
autoCompileListener = ide.$scope.$on "ide:opAcknowledged", _.debounce(triggerAutoCompile, AUTO_COMPILE_TIMEOUT)
else
autoCompileListener() if autoCompileListener
autoCompileListener = null