From 29dd51439da9b7aef1d84be146ca787df24c50f7 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Wed, 8 Jun 2016 13:32:21 +0100 Subject: [PATCH] [Date Input] Addressed issues with date selector. Fixes #1000 --- .../res/templates/controls/datetime-field.html | 10 ++++++---- .../src/controllers/DateTimeFieldController.js | 12 +++++++++++- .../general/src/directives/MCTClickElsewhere.js | 4 +++- .../general/test/directives/MCTClickElsewhereSpec.js | 2 ++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/platform/commonUI/general/res/templates/controls/datetime-field.html b/platform/commonUI/general/res/templates/controls/datetime-field.html index 47551fa25b..5f1705bc98 100644 --- a/platform/commonUI/general/res/templates/controls/datetime-field.html +++ b/platform/commonUI/general/res/templates/controls/datetime-field.html @@ -29,10 +29,12 @@ !structure.validate(ngModel[field])), 'picker-icon': structure.format === 'utc' || !structure.format }"> - - + + + +
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); });