Fixes: U4-6953 DatePicker (with time?) seems to be misbehaving since 7.2.8 in Firefox

This commit is contained in:
Shannon
2015-08-20 15:22:10 +02:00
parent 24cb64579b
commit 10108d75b8
3 changed files with 13 additions and 22 deletions

View File

@@ -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;

View File

@@ -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,

View File

@@ -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() {