mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-07 11:17:12 +00:00
Support for sendsActionOnEndEditing in CPControl. Only works for textfields right now.
This commit is contained in:
+2
-1
@@ -94,7 +94,8 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
id _target;
|
||||
SEL _action;
|
||||
int _sendActionOn;
|
||||
|
||||
BOOL _sendsActionOnEndEditing @accessors(property=sendsActionOnEndEditing);
|
||||
|
||||
// Mouse Tracking Support
|
||||
BOOL _continuousTracking;
|
||||
BOOL _trackingWasWithinFrame;
|
||||
|
||||
@@ -269,8 +269,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
|
||||
if (aDOMEvent && aDOMEvent.keyCode == CPReturnKeyCode)
|
||||
{
|
||||
[owner sendAction:[owner action] to:[owner target]];
|
||||
[[owner window] makeFirstResponder:nil];
|
||||
[owner sendAction:[owner action] to:[owner target]];
|
||||
[owner selectText:nil];
|
||||
}
|
||||
else if (aDOMEvent && aDOMEvent.keyCode == CPTabKeyCode)
|
||||
{
|
||||
@@ -666,6 +666,9 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
//post CPControlTextDidEndEditingNotification
|
||||
[self textDidEndEditing:[CPNotification notificationWithName:CPControlTextDidEndEditingNotification object:self userInfo:nil]];
|
||||
|
||||
if ([self sendsActionOnEndEditing])
|
||||
[self sendAction:[self action] to:[self target]];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user