From 124987499a1c21e17d735e5ea1d2e93c81a80351 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Mon, 20 Jun 2016 13:50:05 +0200 Subject: [PATCH] submit date on blur when in accessibility mode As the accessibility mode has no date picker, we can submit it right away --- .../wp-edit/field-types/wp-edit-date-field.directive.html | 1 + .../wp-edit/wp-edit-field/wp-edit-field.directive.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/frontend/app/components/wp-edit/field-types/wp-edit-date-field.directive.html b/frontend/app/components/wp-edit/field-types/wp-edit-date-field.directive.html index a59be6a37f..9517389095 100644 --- a/frontend/app/components/wp-edit/field-types/wp-edit-date-field.directive.html +++ b/frontend/app/components/wp-edit/field-types/wp-edit-date-field.directive.html @@ -7,6 +7,7 @@ type="text" class="wp-inline-edit--field" transform-date-value + ng-blur="vm.onlyInAccessibilityMode(vm.handleUserBlur)" ng-required="vm.field.required" focus="vm.shouldFocus()" focus-priority="vm.shouldFocus()" diff --git a/frontend/app/components/wp-edit/wp-edit-field/wp-edit-field.directive.ts b/frontend/app/components/wp-edit/wp-edit-field/wp-edit-field.directive.ts index eeba44b9e6..52759ab1bd 100644 --- a/frontend/app/components/wp-edit/wp-edit-field/wp-edit-field.directive.ts +++ b/frontend/app/components/wp-edit/wp-edit-field/wp-edit-field.directive.ts @@ -62,6 +62,7 @@ export class WorkPackageEditFieldController { protected $q, protected FocusHelper, protected NotificationsService, + protected ConfigurationService, protected wpCacheService: WorkPackageCacheService, protected I18n) { @@ -251,6 +252,12 @@ export class WorkPackageEditFieldController { this.deactivate(); } + public onlyInAccessibilityMode(callback) { + if (this.ConfigurationService.accessibilityModeEnabled()) { + callback.apply(this); + } + } + protected buildEditField(): ng.IPromise { return this.formCtrl.loadSchema().then(schema => { this.field = this.wpEditField.getField(this.workPackage, this.fieldName, schema[this.fieldName]);