diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index 5107c89a7e..7660178182 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee @@ -35,7 +35,7 @@ define [ url = ace.config._moduleUrl(args...) + "?fingerprint=#{window.aceFingerprint}" return url - App.directive "aceEditor", ($timeout, $compile, $rootScope, event_tracking, localStorage, $cacheFactory, labels, graphics, preamble, ide) -> + App.directive "aceEditor", ($timeout, $compile, $rootScope, event_tracking, localStorage, $cacheFactory, labels, graphics, preamble) -> monkeyPatchSearch($rootScope, $compile) return { @@ -374,16 +374,15 @@ define [ if scope.eventsBridge? session.on "changeScrollTop", onScroll - hasLintingError = null + $rootScope.hasLintingError = false session.on('changeAnnotation', () -> hasErrors = session .getAnnotations() .filter((annotation) -> annotation.type == 'error') .length > 0 - if (hasLintingError != hasErrors) - ide.$scope.$broadcast('ide:lintingError', hasErrors) - hasLintingError = hasErrors + if ($rootScope.hasLintingError != hasErrors) + $rootScope.hasLintingError = hasErrors ) setTimeout () -> diff --git a/services/web/public/coffee/ide/pdf/controllers/AutoCompileController.coffee b/services/web/public/coffee/ide/pdf/controllers/AutoCompileController.coffee index 6d59aa7703..7e28153262 100644 --- a/services/web/public/coffee/ide/pdf/controllers/AutoCompileController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/AutoCompileController.coffee @@ -2,13 +2,8 @@ define [ "base" ], (App) -> App.controller "AutoCompileController", ["$scope", "ide", ($scope, ide) -> - hasLintingError = false - ide.$scope.$on "ide:opAcknowledged", _.debounce(() -> - if (!hasLintingError) + if (!ide.$scope.hasLintingError) $scope.recompile() , 3000) - - ide.$scope.$on "ide:lintingError", (e, hasError) -> - hasLintingError = hasError ] \ No newline at end of file