Skip to content

Commit

Permalink
Add resize method
Browse files Browse the repository at this point in the history
  • Loading branch information
appfeel committed Jun 24, 2015
1 parent 9d65f98 commit 856885f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/ios/OverAppBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,39 @@ - (void)fade:(CDVInvokedUrlCommand *)command {
[UIView commitAnimations];
}

- (void)resize:(CDVInvokedUrlCommand *)command {
NSArray* arguments = [command arguments];

self.callbackId = command.callbackId;
NSUInteger argc = [arguments count];

if (argc < 4) { // at a minimum we need x origin, y origin and width...
return;
}

if (self.overWebView != NULL) {
return;//already created, don't need to create it again
}

CGFloat originx,originy,width;
CGFloat height = 30;
originx = [[arguments objectAtIndex:1] floatValue];
originy = [[arguments objectAtIndex:2] floatValue];
width = [[arguments objectAtIndex:3] floatValue];
if (argc > 3) {
height = [[arguments objectAtIndex:4] floatValue];
}

CGRect viewRect = CGRectMake(
originx,
originy,
width,
height
);

self.overWebView.frame = viewRect;
}

- (BOOL)isValidCallbackId:(NSString *)callbackId
{
NSError *err = nil;
Expand Down

0 comments on commit 856885f

Please sign in to comment.