Refs #1360. Format code.

This commit is contained in:
Alexander Ljungberg
2011-09-16 19:29:53 +01:00
parent b5fb9e8c23
commit 85f8ca9241
+11 -11
View File
@@ -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);
@@ -1357,4 +1357,4 @@ var CPTokenFieldTokenizingCharacterSetKey = "CPTokenFieldTokenizingCharacterSe
[aCoder encodeDouble:_completionDelay forKey:CPTokenFieldCompletionDelayKey];
}
@end
@end