Skip to content

Commit 974ca33

Browse files
authored
Merge pull request apache#254 from NiklasMerz/loading-spinner
CB-13659 (iOS) Add hidespinner option
2 parents 50db5c4 + 695e1b0 commit 974ca33

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ instance, or the system browser.
150150
- __presentationstyle__: Set to `pagesheet`, `formsheet` or `fullscreen` to set the [presentation style](http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle) (defaults to `fullscreen`).
151151
- __transitionstyle__: Set to `fliphorizontal`, `crossdissolve` or `coververtical` to set the [transition style](http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle) (defaults to `coververtical`).
152152
- __toolbarposition__: Set to `top` or `bottom` (default is `bottom`). Causes the toolbar to be at the top or bottom of the window.
153+
- __hidespinner__: Set to `yes` or `no` to change the visibility of the loading indicator (defaults to `no`).
153154

154155
Windows supports these additional options:
155156

src/ios/CDVInAppBrowser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
@property (nonatomic, copy) NSString* navigationbuttoncolor;
5858
@property (nonatomic, assign) BOOL clearcache;
5959
@property (nonatomic, assign) BOOL clearsessioncache;
60+
@property (nonatomic, assign) BOOL hidespinner;
6061

6162
@property (nonatomic, copy) NSString* presentationstyle;
6263
@property (nonatomic, copy) NSString* transitionstyle;

src/ios/CDVInAppBrowser.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,10 @@ - (void)webViewDidStartLoad:(UIWebView*)theWebView
917917
self.backButton.enabled = theWebView.canGoBack;
918918
self.forwardButton.enabled = theWebView.canGoForward;
919919

920-
[self.spinner startAnimating];
920+
NSLog(_browserOptions.hidespinner ? @"Yes" : @"No");
921+
if(!_browserOptions.hidespinner) {
922+
[self.spinner startAnimating];
923+
}
921924

922925
return [self.navigationDelegate webViewDidStartLoad:theWebView];
923926
}
@@ -1017,6 +1020,7 @@ - (id)init
10171020
self.toolbarposition = kInAppBrowserToolbarBarPositionBottom;
10181021
self.clearcache = NO;
10191022
self.clearsessioncache = NO;
1023+
self.hidespinner = NO;
10201024

10211025
self.enableviewportscale = NO;
10221026
self.mediaplaybackrequiresuseraction = NO;

0 commit comments

Comments
 (0)