From c72ebca94fdec8d3d894afd382b57ecd95515050 Mon Sep 17 00:00:00 2001 From: Elizabeth Elwell Date: Tue, 10 May 2016 15:56:58 +0100 Subject: [PATCH] Enabled placeholders to be used for custom directives Placeholders will now work for the input-inline, user-typeahead and project-typeahead directives. Placeholders have been added for the 'Add task' functionality as found on individual story pages. Change-Id: I493950aeab366318c38bc562338ca8e92f2eb7ab --- src/app/stories/template/detail.html | 3 +++ src/app/util/directive/input_inline.js | 3 ++- src/app/util/directive/project_typeahead.js | 3 ++- src/app/util/directive/user_typeahead.js | 3 ++- src/app/util/template/input_inline.html | 2 +- src/app/util/template/project_typeahead.html | 1 + src/app/util/template/user_typeahead.html | 1 + 7 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/app/stories/template/detail.html b/src/app/stories/template/detail.html index 0fdea493..2325ac95 100644 --- a/src/app/stories/template/detail.html +++ b/src/app/stories/template/detail.html @@ -482,6 +482,7 @@ empty-disabled-prompt="Not assigned." maxlength="255" as-inline="false" + placeholder="Enter task name" /> @@ -496,6 +497,7 @@ empty-prompt="Click to assign." empty-disabled-prompt="Not assigned." as-inline="false" + placeholder="Enter project name" /> @@ -507,6 +509,7 @@ empty-prompt="Click to assign." empty-disabled-prompt="Not assigned." as-inline="false" + placeholder="Assign user to task" /> diff --git a/src/app/util/directive/input_inline.js b/src/app/util/directive/input_inline.js index c615af24..b7a145b3 100644 --- a/src/app/util/directive/input_inline.js +++ b/src/app/util/directive/input_inline.js @@ -32,7 +32,8 @@ angular.module('sb.util').directive('inputInline', onChange: '&', emptyPrompt: '@', emptyDisabledPrompt: '@', - maxLength: '=' + maxLength: '=', + placeholder: '@placeholder' }, link: function ($scope, element, attrs, ngModel) { /** diff --git a/src/app/util/directive/project_typeahead.js b/src/app/util/directive/project_typeahead.js index b76bdba6..2af919d2 100644 --- a/src/app/util/directive/project_typeahead.js +++ b/src/app/util/directive/project_typeahead.js @@ -31,7 +31,8 @@ angular.module('sb.util').directive('projectTypeahead', autoFocus: '=', onChange: '&', emptyPrompt: '@', - emptyDisabledPrompt: '@' + emptyDisabledPrompt: '@', + placeholder: '@placeholder' }, link: function ($scope, element, attrs, ngModel) { /** diff --git a/src/app/util/directive/user_typeahead.js b/src/app/util/directive/user_typeahead.js index 65dce9c1..8531f473 100644 --- a/src/app/util/directive/user_typeahead.js +++ b/src/app/util/directive/user_typeahead.js @@ -33,7 +33,8 @@ angular.module('sb.util').directive('userTypeahead', onBlur: '&', onFocus: '&', emptyPrompt: '@', - emptyDisabledPrompt: '@' + emptyDisabledPrompt: '@', + placeholder: '@placeholder' }, link: function ($scope, element, attrs, ngModel) { /** diff --git a/src/app/util/template/input_inline.html b/src/app/util/template/input_inline.html index 51c77754..da787ab9 100644 --- a/src/app/util/template/input_inline.html +++ b/src/app/util/template/input_inline.html @@ -1,7 +1,6 @@
-

diff --git a/src/app/util/template/project_typeahead.html b/src/app/util/template/project_typeahead.html index a26c6091..7f39e6c2 100644 --- a/src/app/util/template/project_typeahead.html +++ b/src/app/util/template/project_typeahead.html @@ -48,6 +48,7 @@ typeahead-loading="loadingProjects" typeahead-input-formatter="formatProjectName($model)" typeahead-on-select="updateViewValue($model.id);" + placeholder="{{placeholder}}" ng-model="selectedProject"/>