|
164 | 164 | ctrl.multiple = false; // Initialized inside uiSelect directive link function
|
165 | 165 | ctrl.disableChoiceExpression = undefined; // Initialized inside uiSelect directive link function
|
166 | 166 | ctrl.$filter = $filter;
|
| 167 | + ctrl.taggingTokens = {isActivated: false, tokens: undefined}; |
167 | 168 |
|
168 | 169 | ctrl.isEmpty = function() {
|
169 | 170 | return angular.isUndefined(ctrl.selected) || ctrl.selected === null || ctrl.selected === '';
|
|
176 | 177 |
|
177 | 178 | // Most of the time the user does not want to empty the search input when in typeahead mode
|
178 | 179 | function _resetSearchInput() {
|
179 |
| - if (ctrl.resetSearchInput) { |
| 180 | + if (ctrl.resetSearchInput || ctrl.tagging.isActivated ) { |
180 | 181 | ctrl.search = EMPTY_SEARCH;
|
181 | 182 | //reset activeIndex
|
182 | 183 | if (ctrl.selected && ctrl.items.length && !ctrl.multiple) {
|
|
970 | 971 | // associated with tagging
|
971 | 972 | if ( attrs.taggingLabel === 'false' ) {
|
972 | 973 | $select.taggingLabel = false;
|
973 |
| - } else { |
| 974 | + } |
| 975 | + else |
| 976 | + { |
974 | 977 | $select.taggingLabel = attrs.taggingLabel !== undefined ? attrs.taggingLabel : '(new)';
|
975 | 978 | }
|
976 | 979 | }
|
977 | 980 | });
|
978 | 981 |
|
979 | 982 | attrs.$observe('taggingTokens', function() {
|
980 |
| - if(attrs.tagging !== undefined && attrs.taggingTokens !== undefined) |
981 |
| - { |
982 |
| - var tokens = attrs.taggingTokens !== undefined ? attrs.taggingTokens.split('|') : [',']; |
983 |
| - $select.taggingTokens = {isActivated: true, tokens: tokens }; |
984 |
| - } |
985 |
| - else |
986 |
| - { |
987 |
| - $select.taggingTokens = {isActivated: false, tokens: undefined}; |
| 983 | + if (attrs.tagging !== undefined) { |
| 984 | + var tokens = attrs.taggingTokens !== undefined ? attrs.taggingTokens.split('|') : [',','ENTER']; |
| 985 | + $select.taggingTokens = {isActivated: true, tokens: tokens }; |
988 | 986 | }
|
989 | 987 | });
|
990 | 988 |
|
|
0 commit comments