Fixes: U4-6953 DatePicker (with time?) seems to be misbehaving since 7.2.8 in Firefox
This commit is contained in:
@@ -242,18 +242,19 @@ angular.module('umbraco.services')
|
||||
|
||||
_.each(assets, function (asset) {
|
||||
LazyLoad.js(appendRnd(asset.path), function () {
|
||||
asset.state = "loaded";
|
||||
if (!scope) {
|
||||
asset.state = "loaded";
|
||||
asset.deferred.resolve(true);
|
||||
} else {
|
||||
asset.state = "loaded";
|
||||
}
|
||||
else {
|
||||
angularHelper.safeApply(scope, function () {
|
||||
asset.deferred.resolve(true);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
//return and resolve
|
||||
var deferred = $q.defer();
|
||||
promise = deferred.promise;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
assetsService.load([
|
||||
//"lib/spectrum/tinycolor.js",
|
||||
"lib/spectrum/spectrum.js"
|
||||
]).then(function () {
|
||||
], $scope).then(function () {
|
||||
var elem = $element.find("input");
|
||||
elem.spectrum({
|
||||
color: null,
|
||||
|
||||
@@ -43,12 +43,7 @@ function dateTimePickerController($scope, notificationsService, assetsService, a
|
||||
if (e.date && e.date.isValid()) {
|
||||
$scope.datePickerForm.datepicker.$setValidity("pickerError", true);
|
||||
$scope.hasDatetimePickerValue = true;
|
||||
if (!$scope.model.config.format) {
|
||||
$scope.datetimePickerValue = e.date;
|
||||
}
|
||||
else {
|
||||
$scope.datetimePickerValue = e.date.format($scope.model.config.format);
|
||||
}
|
||||
$scope.datetimePickerValue = e.date.format($scope.model.config.format);
|
||||
}
|
||||
else {
|
||||
$scope.hasDatetimePickerValue = false;
|
||||
@@ -82,8 +77,8 @@ function dateTimePickerController($scope, notificationsService, assetsService, a
|
||||
$scope.model.config.language = user.locale;
|
||||
|
||||
|
||||
assetsService.load(filesToLoad).then(
|
||||
function () {
|
||||
assetsService.load(filesToLoad, $scope).then(
|
||||
function () {
|
||||
//The Datepicker js and css files are available and all components are ready to use.
|
||||
|
||||
// Get the id of the datepicker button that was clicked
|
||||
@@ -102,15 +97,10 @@ function dateTimePickerController($scope, notificationsService, assetsService, a
|
||||
|
||||
if ($scope.hasDatetimePickerValue) {
|
||||
|
||||
//assign value to plugin/picker
|
||||
element.datetimepicker("setValue", $scope.model.value ? new Date($scope.model.value) : moment());
|
||||
|
||||
if (!$scope.model.config.format) {
|
||||
$scope.datetimePickerValue = moment($scope.model.value);
|
||||
}
|
||||
else {
|
||||
$scope.datetimePickerValue = moment($scope.model.value).format($scope.model.config.format);
|
||||
}
|
||||
//assign value to plugin/picker
|
||||
var dateVal = $scope.model.value ? moment($scope.model.value, $scope.model.config.format) : moment();
|
||||
element.datetimepicker("setValue", dateVal);
|
||||
$scope.datetimePickerValue = moment($scope.model.value).format($scope.model.config.format);
|
||||
}
|
||||
|
||||
element.find("input").bind("blur", function() {
|
||||
|
||||
Reference in New Issue
Block a user