@@ -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
+ ]