diff options
Diffstat (limited to 'UICaboodle')
-rw-r--r-- | UICaboodle/BrowserView.h | 2 | ||||
-rw-r--r-- | UICaboodle/BrowserView.mm | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/UICaboodle/BrowserView.h b/UICaboodle/BrowserView.h index 4e9be45..51cb345 100644 --- a/UICaboodle/BrowserView.h +++ b/UICaboodle/BrowserView.h @@ -130,4 +130,6 @@ - (void) dispatchEvent:(NSString *)event; +- (void) setViewportWidthOnMainThread:(float)value; + @end diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm index d549640..43f2905 100644 --- a/UICaboodle/BrowserView.mm +++ b/UICaboodle/BrowserView.mm @@ -646,6 +646,14 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se [self _setViewportWidth]; } +- (void) _setViewportWidthOnMainThread:(NSNumber *)width { + [self setViewportWidth:[width floatValue]]; +} + +- (void) setViewportWidthOnMainThread:(float)width { + [self performSelectorOnMainThread:@selector(_setViewportWidthOnMainThread:) withObject:[NSNumber numberWithFloat:width] waitUntilDone:NO]; +} + - (void) webViewUpdateViewSettings:(UIWebView *)view { [self _setViewportWidth]; } |