diff --git a/platform/commonUI/general/bundle.json b/platform/commonUI/general/bundle.json index f9fb3a6538..2f8d036bc1 100644 --- a/platform/commonUI/general/bundle.json +++ b/platform/commonUI/general/bundle.json @@ -54,10 +54,6 @@ { "key": "time-controller", "templateUrl": "templates/controls/time-controller.html" - }, - { - "key": "datetime-picker", - "templateUrl": "templates/controls/datetime-picker.html" } ], "controllers": [ @@ -249,6 +245,10 @@ { "key": "selector", "templateUrl": "templates/controls/selector.html" + }, + { + "key": "datetime-picker", + "templateUrl": "templates/controls/datetime-picker.html" } ], "licenses": [ diff --git a/platform/commonUI/general/res/templates/controls/datetime-picker.html b/platform/commonUI/general/res/templates/controls/datetime-picker.html index 0f43da1ab0..dd774588d6 100644 --- a/platform/commonUI/general/res/templates/controls/datetime-picker.html +++ b/platform/commonUI/general/res/templates/controls/datetime-picker.html @@ -51,7 +51,7 @@
+ ng-if="options[key]">
{{nameFor(key)}}
+ Start: {{ngModel.outer.start}} @@ -31,10 +31,11 @@
- - + +
diff --git a/platform/commonUI/general/src/controllers/DateTimePickerController.js b/platform/commonUI/general/src/controllers/DateTimePickerController.js index 9282d2db3c..a0821ea967 100644 --- a/platform/commonUI/general/src/controllers/DateTimePickerController.js +++ b/platform/commonUI/general/src/controllers/DateTimePickerController.js @@ -136,7 +136,7 @@ define( minute: $scope.time.minutes, second: $scope.time.seconds }); - $scope.ngModel = m.valueOf(); + $scope.ngModel[$scope.field] = m.valueOf(); } $scope.isSelectable = function (cell) { @@ -189,10 +189,11 @@ define( updateScopeForMonth(); // Ensure some useful default - $scope.ngModel = $scope.ngModel === undefined ? - now() : $scope.ngModel; + $scope.ngModel[$scope.field] = + $scope.ngModel[$scope.field] === undefined ? + now() : $scope.ngModel[$scope.field]; - $scope.$watch('ngModel', updateFromModel); + $scope.$watch('ngModel[field]', updateFromModel); $scope.$watchCollection('date', updateFromView); $scope.$watchCollection('time', updateFromView); } diff --git a/platform/commonUI/general/src/directives/MCTClickElsewhere.js b/platform/commonUI/general/src/directives/MCTClickElsewhere.js index a6066fc271..1bcdbbe6b5 100644 --- a/platform/commonUI/general/src/directives/MCTClickElsewhere.js +++ b/platform/commonUI/general/src/directives/MCTClickElsewhere.js @@ -26,6 +26,13 @@ define( function () { "use strict"; + /** + * The `mct-click-elsewhere` directive will evaluate its + * associated expression whenever a `mousedown` occurs anywhere + * outside of the element that has the `mct-click-elsewhere` + * directive attached. This is useful for dismissing popups + * and the like. + */ function MCTClickElsewhere($document) { // Link; install event handlers. diff --git a/platform/commonUI/general/src/directives/MCTPopup.js b/platform/commonUI/general/src/directives/MCTPopup.js index 0e9f6f1586..6dbf3666fc 100644 --- a/platform/commonUI/general/src/directives/MCTPopup.js +++ b/platform/commonUI/general/src/directives/MCTPopup.js @@ -25,7 +25,7 @@ define( function () { var TEMPLATE = "
"; - function MCTPopup($window, $document, $compile, $interval) { + function MCTPopup($window, $document, $compile) { function link(scope, element, attrs, ctrl, transclude) { var body = $document.find('body'), popup = $compile(TEMPLATE)(scope), @@ -52,7 +52,6 @@ define( scope.$on('$destroy', function () { popup.remove(); - $interval.cancel(activeInterval); }); }