Skip to content

Commit

Permalink
Refs cappuccino#1360. Format code.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljungberg committed Sep 16, 2011
1 parent b5fb9e8 commit 85f8ca9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions AppKit/CPTokenField.j
Expand Up @@ -206,23 +206,23 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
// Explicitly remove the last object because the array contains strings and removeObject uses isEqual to compare objects
if (shouldRemoveLastObject)
[objectValue removeObjectAtIndex:_selectedRange.location];
//confirm with the delegate the token inclusion

// Give the delegate a chance to confirm, replace or add to the list of tokens being added.
delegateApprovedObjects = [self tokenField:self shouldAddObjects:[CPArray arrayWithObject:token] atIndex:index];
if (delegateApprovedObjects)
{
for(var i = 0; i < [delegateApprovedObjects count]; i++)
for (var i = 0; i < [delegateApprovedObjects count]; i++)
{
[objectValue insertObject:[delegateApprovedObjects objectAtIndex:i] atIndex:_selectedRange.location + i];
}
[objectValue insertObject:[delegateApprovedObjects objectAtIndex:i] atIndex:_selectedRange.location + i];
}
}
var location = _selectedRange.location;
var delegateApprovedObjectsCount = [delegateApprovedObjects count];

var location = _selectedRange.location,
delegateApprovedObjectsCount = [delegateApprovedObjects count];
[self setObjectValue:objectValue];
//this part puts the cursor after the last token
if(delegateApprovedObjectsCount > 1)
_selectedRange = CPMakeRange(location + delegateApprovedObjectsCount - 1, 0);
if (delegateApprovedObjectsCount > 1)
_selectedRange = CPMakeRange(location + delegateApprovedObjectsCount - 1, 0);
else
_selectedRange = CPMakeRange(location + 1, 0);

Expand Down Expand Up @@ -1357,4 +1357,4 @@ var CPTokenFieldTokenizingCharacterSetKey = "CPTokenFieldTokenizingCharacterSe
[aCoder encodeDouble:_completionDelay forKey:CPTokenFieldCompletionDelayKey];
}

@end
@end

0 comments on commit 85f8ca9

Please sign in to comment.