xMax || y < yMin || y > yMax) {
- scope.$eval(attrs.mctClickElsewhere);
+ scope.$apply(function () {
+ scope.$eval(attrs.mctClickElsewhere);
+ });
}
}
diff --git a/platform/commonUI/general/test/directives/MCTClickElsewhereSpec.js b/platform/commonUI/general/test/directives/MCTClickElsewhereSpec.js
index 2e782a1a01..53924b0dd7 100644
--- a/platform/commonUI/general/test/directives/MCTClickElsewhereSpec.js
+++ b/platform/commonUI/general/test/directives/MCTClickElsewhereSpec.js
@@ -104,6 +104,8 @@ define(
});
it("triggers an evaluation of its related Angular expression", function () {
+ expect(mockScope.$apply).toHaveBeenCalled();
+ mockScope.$apply.mostRecentCall.args[0]();
expect(mockScope.$eval)
.toHaveBeenCalledWith(testAttrs.mctClickElsewhere);
});