Skip to content

Commit 695e1b0

Browse files
committed
CB-13659 (iOS) Add hidespinner option
Signed-off-by: Niklas Merz <[email protected]>
1 parent 0f2f14a commit 695e1b0

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ instance, or the system browser.
101101

102102
- __options__: Options for the `InAppBrowser`. Optional, defaulting to: `location=yes`. _(String)_
103103

104-
The `options` string must not contain any blank space, and each feature's name/value pairs must be separated by a comma. Feature names are case insensitive.
105-
104+
The `options` string must not contain any blank space, and each feature's name/value pairs must be separated by a comma. Feature names are case insensitive.
105+
106106
All platforms support:
107107

108108
- __location__: Set to `yes` or `no` to turn the `InAppBrowser`'s location bar on or off.
@@ -134,6 +134,7 @@ instance, or the system browser.
134134
- __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`).
135135
- __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`).
136136
- __toolbarposition__: Set to `top` or `bottom` (default is `bottom`). Causes the toolbar to be at the top or bottom of the window.
137+
- __hidespinner__: Set to `yes` or `no` to change the visibility of the loading indicator (defaults to `no`).
137138

138139
Windows supports these additional options:
139140

src/ios/CDVInAppBrowser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
@property (nonatomic, copy) NSString* toolbarposition;
5353
@property (nonatomic, assign) BOOL clearcache;
5454
@property (nonatomic, assign) BOOL clearsessioncache;
55+
@property (nonatomic, assign) BOOL hidespinner;
5556

5657
@property (nonatomic, copy) NSString* presentationstyle;
5758
@property (nonatomic, copy) NSString* transitionstyle;
@@ -74,13 +75,13 @@
7475
NSString* _prevUserAgent;
7576
NSInteger _userAgentLockToken;
7677
CDVInAppBrowserOptions *_browserOptions;
77-
78+
7879
#ifdef __CORDOVA_4_0_0
7980
CDVUIWebViewDelegate* _webViewDelegate;
8081
#else
8182
CDVWebViewDelegate* _webViewDelegate;
8283
#endif
83-
84+
8485
}
8586

8687
@property (nonatomic, strong) IBOutlet UIWebView* webView;
@@ -110,4 +111,3 @@
110111
@property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;
111112

112113
@end
113-

src/ios/CDVInAppBrowser.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,10 @@ - (void)webViewDidStartLoad:(UIWebView*)theWebView
887887
self.backButton.enabled = theWebView.canGoBack;
888888
self.forwardButton.enabled = theWebView.canGoForward;
889889

890-
[self.spinner startAnimating];
890+
NSLog(_browserOptions.hidespinner ? @"Yes" : @"No");
891+
if(!_browserOptions.hidespinner) {
892+
[self.spinner startAnimating];
893+
}
891894

892895
return [self.navigationDelegate webViewDidStartLoad:theWebView];
893896
}
@@ -987,6 +990,7 @@ - (id)init
987990
self.toolbarposition = kInAppBrowserToolbarBarPositionBottom;
988991
self.clearcache = NO;
989992
self.clearsessioncache = NO;
993+
self.hidespinner = NO;
990994

991995
self.enableviewportscale = NO;
992996
self.mediaplaybackrequiresuseraction = NO;
@@ -1104,4 +1108,3 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
11041108

11051109

11061110
@end
1107-

0 commit comments

Comments
 (0)