mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-10 12:47:13 +00:00
Merge branch 'refs/heads/slevenbits-tabbing-fix' into slevenbits
This commit is contained in:
+12
-5
@@ -138,6 +138,11 @@ var CPScrollDestinationNone = 0,
|
||||
return _autocompleteMenu;
|
||||
}
|
||||
|
||||
- (void)_complete:(_CPAutocompleteMenu)anAutocompleteMenu
|
||||
{
|
||||
[self _autocompleteWithEvent:nil];
|
||||
}
|
||||
|
||||
- (void)_autocompleteWithEvent:(CPEvent)anEvent
|
||||
{
|
||||
if (![self _inputElement].value && (![_autocompleteMenu contentArray] || ![self hasThemeState:CPThemeStateAutocompleting]))
|
||||
@@ -647,10 +652,13 @@ var CPScrollDestinationNone = 0,
|
||||
if (CPTokenFieldInputOwner && CPTokenFieldInputOwner._preventResign)
|
||||
return false;
|
||||
|
||||
if (!CPTokenFieldInputResigning && !CPTokenFieldFocusInput)
|
||||
if (!CPTokenFieldInputResigning && [[CPTokenFieldInputOwner window] isKeyWindow])
|
||||
{
|
||||
[[CPTokenFieldInputOwner window] makeFirstResponder:nil];
|
||||
return;
|
||||
// If we lost focus somehow but we're not resigning and we're still in the key window, we'll need to take it back.
|
||||
window.setTimeout(function()
|
||||
{
|
||||
CPTokenFieldDOMInputElement.focus();
|
||||
}, 0.0);
|
||||
}
|
||||
|
||||
CPTokenFieldHandleBlur(anEvent, CPTokenFieldDOMInputElement);
|
||||
@@ -988,8 +996,7 @@ var CPScrollDestinationNone = 0,
|
||||
|
||||
var frame = [self frame],
|
||||
contentView = [_tokenScrollView documentView],
|
||||
tokens = [self _tokens],
|
||||
shouldShowAutoComplete = [self hasThemeState:CPThemeStateAutocompleting];
|
||||
tokens = [self _tokens];
|
||||
|
||||
// Hack to make sure we are handling an array
|
||||
if (![tokens isKindOfClass:[CPArray class]])
|
||||
|
||||
@@ -1856,7 +1856,9 @@ CPTexturedBackgroundWindowMask
|
||||
*/
|
||||
- (BOOL)canBecomeKeyWindow
|
||||
{
|
||||
return YES;
|
||||
// In Cocoa only resizable or titled windows return YES here by default. But the main browser window in Cappuccino
|
||||
// doesn't have these masks even that it's both titled and resizable, so we return YES when isFullPlatformWindow too.
|
||||
return (_styleMask & CPResizableWindowMask) || (_styleMask & CPResizableWindowMask) || [self isFullPlatformWindow];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -73,6 +73,8 @@ var _CPAutocompleteMenuMaximumHeight = 307;
|
||||
|
||||
[tableView setDataSource:self];
|
||||
[tableView setDelegate:self];
|
||||
[tableView setTarget:self];
|
||||
[tableView setAction:@selector(complete:)];
|
||||
[tableView setAllowsMultipleSelection:NO];
|
||||
[tableView setHeaderView:nil];
|
||||
[tableView setCornerView:nil];
|
||||
@@ -251,6 +253,11 @@ var _CPAutocompleteMenuMaximumHeight = 307;
|
||||
return [contentArray objectAtIndex:row];
|
||||
}
|
||||
|
||||
- (@action)complete:(id)sender
|
||||
{
|
||||
[textField _complete:self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user