Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-13560] iOS: bubbleParent property does not work properly #4237

Merged
merged 1 commit into from
May 9, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion iphone/Classes/KrollObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ -(void)setValue:(id)value forKey:(NSString *)key
return;
}
selector = NSSelectorFromString([NSString stringWithFormat:@"set%@:",name]);
if ([target respondsToSelector:selector] && ![name isEqualToString:@"ZIndex"] && ![name isEqualToString:@"BubbleParent"])//TODO: Quick hack is quick.
if ([target respondsToSelector:selector] && ![name isEqualToString:@"ZIndex"])//TODO: Quick hack is quick.
{
[target performSelector:selector withObject:value];
}
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiBindingEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void TiBindingEventSetBubbles(TiBindingEvent event, bool bubbles)
{
while (![currentTarget _hasListeners:event->eventString] || parentOnly)
{
if (![currentTarget bubbleParent] || !event->bubbles || event->cancelBubble)
if (!currentTarget->_bubbleParent || !event->bubbles || event->cancelBubble)
{ //If currentTarget is nil, this triggers as well.
return nil;
}
Expand Down
5 changes: 3 additions & 2 deletions iphone/Classes/TiProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void DoProxyDelegateReadValuesWithKeysFromProxy(UIView<TiProxyDelegate> * target
*/
@interface TiProxy : NSObject<KrollTargetable> {
@public
BOOL bubbleParent;
BOOL _bubbleParent;

@private
NSMutableDictionary *listeners;
Expand Down Expand Up @@ -225,7 +225,8 @@ void DoProxyDelegateReadValuesWithKeysFromProxy(UIView<TiProxyDelegate> * target
is the type that has a parent to bubble to (This is primairly views, but may
have some exceptions).
*/
@property(nonatomic,readwrite,assign) BOOL bubbleParent;
-(NSNumber*)bubbleParent;
-(void)setBubbleParent:(id)arg;

#pragma mark Utility
-(KrollObject *)krollObjectForContext:(KrollContext *)context;
Expand Down
14 changes: 11 additions & 3 deletions iphone/Classes/TiProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ -(id)init
{
if (self = [super init])
{
bubbleParent = YES;
_bubbleParent = YES;
#if PROXY_MEMORY_TRACK == 1
NSLog(@"[DEBUG] INIT: %@ (%d)",self,[self hash]);
#endif
Expand Down Expand Up @@ -563,8 +563,6 @@ -(id)_proxy:(TiProxyBridgeType)type

#pragma mark Public

@synthesize bubbleParent;

-(id<NSFastEnumeration>)allKeys
{
pthread_rwlock_rdlock(&dynpropsLock);
Expand All @@ -574,6 +572,16 @@ -(id)_proxy:(TiProxyBridgeType)type
return keys;
}

-(NSNumber*)bubbleParent
{
return NUMBOOL(_bubbleParent);
}

-(void)setBubbleParent:(id)arg
{
_bubbleParent = [TiUtils boolValue:arg def:YES];
}

/*
* In views where the order in which keys are applied matter (I'm looking at you, TableView), this should be
* an array of which keys go first, and in what order. Otherwise, this is nil.
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiViewProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ -(id)init
{
destroyLock = [[NSRecursiveLock alloc] init];
pthread_rwlock_init(&childrenLock, NULL);
bubbleParent = YES;
_bubbleParent = YES;
}
return self;
}
Expand Down