cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-13498) (inappbrowser) Add closebutton option for ios
Date Thu, 30 Nov 2017 07:59:01 GMT

    [ https://issues.apache.org/jira/browse/CB-13498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16272296#comment-16272296
] 

ASF GitHub Bot commented on CB-13498:
-------------------------------------

jaapjanfrans closed pull request #247: CB-13498 added closebutton option for ios
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/247
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index a4b7cd92..84bd3996 100644
--- a/README.md
+++ b/README.md
@@ -123,6 +123,7 @@ instance, or the system browser.
     - __hidden__: set to `yes` to create the browser and load the page, but not show it.
The loadstop event fires when loading is complete. Omit or set to `no` (default) to have the
browser open and load normally.
     - __clearcache__: set to `yes` to have the browser's cookie cache cleared before the
new window is opened
     - __clearsessioncache__: set to `yes` to have the session cookie cache cleared before
the new window is opened    
+    - __closebutton__: set to `yes` or `no` to turn the close button on or off for the InAppBrowser's
toolbar (defaults to `yes`)
     - __closebuttoncaption__: set to a string to use as the __Done__ button's caption. Note
that you need to localize this value yourself.
     - __disallowoverscroll__: Set to `yes` or `no` (default is `no`). Turns on/off the UIWebViewBounce
property.
     - __toolbar__:  set to `yes` or `no` to turn the toolbar on or off for the InAppBrowser
(defaults to `yes`)
diff --git a/src/ios/CDVInAppBrowser.h b/src/ios/CDVInAppBrowser.h
index d258eb09..64aedda4 100644
--- a/src/ios/CDVInAppBrowser.h
+++ b/src/ios/CDVInAppBrowser.h
@@ -49,6 +49,7 @@
 @property (nonatomic, assign) BOOL location;
 @property (nonatomic, assign) BOOL toolbar;
 @property (nonatomic, copy) NSString* closebuttoncaption;
+@property (nonatomic, assign) BOOL closebutton;
 @property (nonatomic, copy) NSString* toolbarposition;
 @property (nonatomic, assign) BOOL clearcache;
 @property (nonatomic, assign) BOOL clearsessioncache;
diff --git a/src/ios/CDVInAppBrowser.m b/src/ios/CDVInAppBrowser.m
index f5d05f01..1d631b7c 100644
--- a/src/ios/CDVInAppBrowser.m
+++ b/src/ios/CDVInAppBrowser.m
@@ -642,7 +642,11 @@ - (void)createViews
     self.backButton.enabled = YES;
     self.backButton.imageInsets = UIEdgeInsetsZero;
 
-    [self.toolbar setItems:@[self.closeButton, flexibleSpaceButton, self.backButton, fixedSpaceButton,
self.forwardButton]];
+    if(_browserOptions.closebutton) {
+        [self.toolbar setItems:@[self.closeButton, flexibleSpaceButton, self.backButton,
fixedSpaceButton, self.forwardButton]];
+    } else {
+        [self.toolbar setItems:@[flexibleSpaceButton, self.backButton, fixedSpaceButton,
self.forwardButton]];
+    }
 
     self.view.backgroundColor = [UIColor grayColor];
     [self.view addSubview:self.toolbar];
@@ -984,6 +988,7 @@ - (id)init
         self.location = YES;
         self.toolbar = YES;
         self.closebuttoncaption = nil;
+        self.closebutton = YES;
         self.toolbarposition = kInAppBrowserToolbarBarPositionBottom;
         self.clearcache = NO;
         self.clearsessioncache = NO;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> (inappbrowser) Add closebutton option for ios
> ---------------------------------------------
>
>                 Key: CB-13498
>                 URL: https://issues.apache.org/jira/browse/CB-13498
>             Project: Apache Cordova
>          Issue Type: New Feature
>            Reporter: Jaap-Jan
>
> On ios the toolbar has a close button and back/next buttons. You can disable the entire
toolbar, but not disable the close button only.
> If a closebutton option is support, you can have a toolbar that only has the navigational
buttons. 
> I needed this for a project that needs to keep the inappbrowser opened at all times (so
a close button should not be shown)  but also requires to have navigational buttons of the
toolbar.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message