Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit bea7631

Browse files
author
Brian Feister
committed
Make JSHint happy
1 parent fc93c66 commit bea7631

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/select.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@
604604

605605
$scope.$apply(function() {
606606
var processed = false;
607+
var tagged = false;
607608

608609
if(ctrl.multiple && KEY.isHorizontalMovement(key)){
609610
processed = _handleMatchSelection(key);
@@ -616,17 +617,20 @@
616617
if ( ctrl.taggingTokens.tokens[i] === KEY.MAP[e.keyCode] ) {
617618
// make sure there is a new value to push via tagging
618619
if ( ctrl.search.length > 0 ) {
619-
$timeout(function() {
620-
_searchInput.triggerHandler('tagged', ctrl.items);
621-
var newItem = ctrl.search.replace(KEY.MAP[e.keyCode],'').trim();
622-
if ( ctrl.tagging.fct ) {
623-
newItem = ctrl.tagging.fct( newItem );
624-
}
625-
ctrl.select( newItem, true);
626-
});
620+
tagged = true;
627621
}
628622
}
629623
}
624+
if ( tagged ) {
625+
$timeout(function() {
626+
_searchInput.triggerHandler('tagged', ctrl.items);
627+
var newItem = ctrl.search.replace(KEY.MAP[e.keyCode],'').trim();
628+
if ( ctrl.tagging.fct ) {
629+
newItem = ctrl.tagging.fct( newItem );
630+
}
631+
ctrl.select( newItem, true);
632+
});
633+
}
630634
}
631635
}
632636

@@ -662,7 +666,7 @@
662666
// taggingLabel === false bypasses all of this
663667
if (ctrl.taggingLabel === false) return;
664668

665-
var items = angular.copy( ctrl.items )
669+
var items = angular.copy( ctrl.items );
666670
var stashArr = angular.copy( ctrl.items );
667671
var newItem;
668672
var item;

0 commit comments

Comments
 (0)