mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-18 08:31:28 +00:00
Submitted the right CPTokenField file, was missing the part to use the delegate approved tokens. Still lacks a way to put the cursor after the last token (if the delegate returns more than one token)
This commit is contained in:
@@ -208,8 +208,14 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
||||
[objectValue removeObjectAtIndex:_selectedRange.location];
|
||||
|
||||
//confirm with the delegate the token inclusion
|
||||
if ([[self tokenField:self shouldAddObjects:[CPArray arrayWithObject:token] atIndex:index] count])
|
||||
[objectValue insertObject:token atIndex:_selectedRange.location];
|
||||
delegateApprovedObjects = [self tokenField:self shouldAddObjects:[CPArray arrayWithObject:token] atIndex:index];
|
||||
if (delegateApprovedObjects)
|
||||
{
|
||||
for(var i = 0; i < [delegateApprovedObjects count]; i++)
|
||||
{
|
||||
[objectValue insertObject:[delegateApprovedObjects objectAtIndex:i] atIndex:_selectedRange.location + i];
|
||||
}
|
||||
}
|
||||
|
||||
var location = _selectedRange.location;
|
||||
[self setObjectValue:objectValue];
|
||||
|
||||
Reference in New Issue
Block a user