|
17 | 17 | link: function (scope, element, attrs, ngModel) {
|
18 | 18 | var pendingSaveRequest = null;
|
19 | 19 | var options = {
|
| 20 | + showPlaceholderCount: false, |
20 | 21 | deleteKeyAlwaysChangeValue: false,
|
21 | 22 | lazySaveTimeout: ariaNgConstants.lazySaveTimeout,
|
22 | 23 | errorTooltipPlacement: 'top',
|
|
85 | 86 | };
|
86 | 87 |
|
87 | 88 | var getTotalCount = function (itemsText, separator, trim) {
|
88 |
| - if (!itemsText || !angular.isString(itemsText)) { |
| 89 | + if (!itemsText || !separator || !angular.isString(itemsText)) { |
89 | 90 | return 0;
|
90 | 91 | }
|
91 | 92 |
|
|
180 | 181 | var fixedValueCount = getTotalCount(scope.fixedValue, scope.option.separator, scope.option.trimCount);
|
181 | 182 | var inputValueCount = getTotalCount(scope.optionValue, scope.option.separator, scope.option.trimCount);
|
182 | 183 |
|
| 184 | + if (!scope.optionValue && scope.showPlaceholderCount && scope.placeholderItemCount) { |
| 185 | + inputValueCount = scope.placeholderItemCount; |
| 186 | + } |
| 187 | + |
183 | 188 | return fixedValueCount + inputValueCount;
|
184 | 189 | };
|
185 | 190 |
|
|
313 | 318 | }
|
314 | 319 |
|
315 | 320 | scope.placeholder = getHumanReadableValue(displayValue);
|
| 321 | + |
| 322 | + if (scope.option) { |
| 323 | + scope.placeholderItemCount = getTotalCount(scope.placeholder, scope.option.separator, scope.option.trimCount); |
| 324 | + } else { |
| 325 | + scope.placeholderItemCount = 0; |
| 326 | + } |
316 | 327 | });
|
317 | 328 |
|
| 329 | + scope.showPlaceholderCount = options.showPlaceholderCount === true || options.showPlaceholderCount === 'true'; |
318 | 330 | loadHistory();
|
319 | 331 | }
|
320 | 332 | };
|
|
0 commit comments