From e63c00a86ad29173a28b819f888a8d1f104a4e4f Mon Sep 17 00:00:00 2001 From: Florian Kraft Date: Mon, 22 Jun 2015 11:53:07 +0200 Subject: [PATCH 1/2] add a name to the empty options in dropdowns This will add an "empty" label to dropdown options select, based on the "no value label" already existing in the translations. Signed-off-by: Florian Kraft --- .../work_packages/services/work-package-field-service.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/app/work_packages/services/work-package-field-service.js b/frontend/app/work_packages/services/work-package-field-service.js index 14d888dcb7..24101557f6 100644 --- a/frontend/app/work_packages/services/work-package-field-service.js +++ b/frontend/app/work_packages/services/work-package-field-service.js @@ -146,7 +146,11 @@ module.exports = function( }); if (!WorkPackageFieldService.isRequired(workPackage, field)) { - var arrayWithEmptyOption = [{ href: null }]; + var nullValueLabel = I18n.t('js.inplace.null_value_label'); + var arrayWithEmptyOption = [{ + href: null, + name: nullValueLabel + }]; options = arrayWithEmptyOption.concat(options); } From 76c3f9faba66a8b57cb38af2cc1936c8d6e51a6e Mon Sep 17 00:00:00 2001 From: Florian Kraft Date: Mon, 22 Jun 2015 15:49:48 +0200 Subject: [PATCH 2/2] style corrections --- .../app/work_packages/services/work-package-field-service.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/app/work_packages/services/work-package-field-service.js b/frontend/app/work_packages/services/work-package-field-service.js index 24101557f6..0b0ca85ca6 100644 --- a/frontend/app/work_packages/services/work-package-field-service.js +++ b/frontend/app/work_packages/services/work-package-field-service.js @@ -146,10 +146,9 @@ module.exports = function( }); if (!WorkPackageFieldService.isRequired(workPackage, field)) { - var nullValueLabel = I18n.t('js.inplace.null_value_label'); var arrayWithEmptyOption = [{ href: null, - name: nullValueLabel + name: I18n.t('js.inplace.null_value_label') }]; options = arrayWithEmptyOption.concat(options); }