Removed close of date/time picker on date selection when set up with time picker; close picker on click on document
This commit is contained in:
@@ -8,12 +8,21 @@ function dateTimePickerController($scope, notificationsService, assetsService, a
|
||||
pickDate: true,
|
||||
pickTime: true,
|
||||
pick12HourFormat: false,
|
||||
autoclose: true,
|
||||
format: "yyyy-MM-dd hh:mm:ss"
|
||||
};
|
||||
|
||||
//map the user config
|
||||
$scope.model.config = angular.extend(config, $scope.model.config);
|
||||
|
||||
//hide picker if clicking on the document
|
||||
$scope.hidePicker = function () {
|
||||
$element.find("div:first").datetimepicker("hide");
|
||||
};
|
||||
$(document).click(function (event) {
|
||||
$scope.hidePicker();
|
||||
});
|
||||
|
||||
//handles the date changing via the api
|
||||
function applyDate(e) {
|
||||
angularHelper.safeApply($scope, function() {
|
||||
@@ -26,8 +35,10 @@ function dateTimePickerController($scope, notificationsService, assetsService, a
|
||||
$scope.model.value = e.localDate.toIsoDateString();
|
||||
}
|
||||
}
|
||||
|
||||
$element.find("div:first").datetimepicker("hide", 0);
|
||||
|
||||
if (!$scope.model.config.pickTime) {
|
||||
$element.find("div:first").datetimepicker("hide", 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user