mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
First pass at auto compile ctrl
This commit is contained in:
parent
c42b08fcff
commit
dab799a81b
3 changed files with 17 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
div.full-size.pdf(ng-controller="PdfController")
|
||||
.FIXME(ng-controller="AutoCompileController")
|
||||
.toolbar.toolbar-tall
|
||||
.btn-group(
|
||||
dropdown,
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
define [
|
||||
"ide/pdf/controllers/PdfController"
|
||||
"ide/pdf/controllers/PdfViewToggleController"
|
||||
"ide/pdfng/directives/pdfJs"
|
||||
"ide/pdfng/directives/pdfJs",
|
||||
"ide/pdf/controllers/AutoCompileController"
|
||||
], () ->
|
||||
class PdfManager
|
||||
constructor: (@ide, @$scope) ->
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
define [
|
||||
"base"
|
||||
], (App) ->
|
||||
App.controller "AutoCompileController", ["$scope", "ide", ($scope, ide) ->
|
||||
hasLintingError = false
|
||||
|
||||
ide.$scope.$on "ide:opAcknowledged", _.debounce(() ->
|
||||
if (!hasLintingError)
|
||||
$scope.recompile()
|
||||
, 3000)
|
||||
|
||||
ide.$scope.$on "ide:lintingError", (e, hasError) ->
|
||||
hasLintingError = hasError
|
||||
]
|
Loading…
Reference in a new issue