-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CB-8467 provide hide method to hide browser window #101
CB-8467 provide hide method to hide browser window #101
Conversation
+1 |
FFOS +1 |
lgtm |
Hi, Frank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get this in?
Sure I can fix the conflicts. It's ... been a while |
21b131a
to
c70882f
Compare
Added support for hiding the web view container. This maintains the browser session without closing it. The browser window can be repeatedly hidden and shown. ** This has only been tested on android and ios ** amazon/android: An additional `hide` action was added to `InAppBrowser#execute`. It is identical to `show`, except that it calls `dialog.hide()` instead. blackberry10: no changes firefoxos: Added a `hide` method that is identical to `show`, indicating it is not supported. ios: Added a `hide` method that is identical to `show`, except that it uses `dismissViewControllerAnimated`. It checks the value of `_previousStatusBarStyle`. If it is `-1`, the method returns with no action performed. If it is not, it is set to `-1.` ubuntu: Added a `hide` method that sets `CordovaWrapper.global.inappbrowser.visible` to `false`. windows: Added a `hide` method that sets `browserWrap.style.display` to `none`. wp: Added a `hide` method that is identical to `show`, except that it sets `browser.Visibility` to `Visibility.Collapsed` and sets `AppBar.IsVisible` to `false`.
c70882f
to
df8bcaf
Compare
@sfrank87 @digitalskyline conflicts de-conflicts, checks passed |
let there be tests |
Hi. I found an misstake in CDVInAppBrowser.m. The hide method was implemented twice, in line 246 and in line 270. ^^" However, I wonder what's wrong with the android build. After all, the hide implementation is an exact copy of show, except for two words. (i diffed both sections, seems no misstakes). And the Jenkins log seems a bit strange, too. For me, it’s a bit conspicuous that it says “no workspace”. O.o regards |
Btw, I have written a little test case for the hide method, that can be found here. @herrevilkitten just copy&paste the tests.js into the tests/ folder. This adds a litte automatic test, checking for the existence of the JS hide method and a manual test that opens the IAB, than hides it after 2 seconds. regards |
@sfrank87 can you send a PR to @herrevilkitten repo against CB-8467_provide_hide_method_to_hide_browser_window branch removing the duplicate method and adding the test? |
done. regards |
I added this to my project much appreciated! |
…de_browser_window removed duplicate hide method in ios source and add jasmine test cases
Thanks you @sfrank87 for the help with this :) |
let there be tests |
merged, thank you everyone and sorry that it took so long |
Thank you for providing this update! I have one question however. I am using Ionic v2.1.4 with iOS v4.0.1 (not sure that's relevant in this case) and I am seeing that the view controller used in the hide method here does not have any effect. This line: Does not appear to do anything. However, when I make the dismiss call like so: The InAppBrowser is hidden as expected. Can anyone else confirm this? Thanks again! |
@bgallz there is a bug (already reported) about hide not working because of other changes. |
Hi @jcesarmobile Thank you very much |
@bnova-stefan It appears to be https://issues.apache.org/jira/browse/CB-12586 |
Added support for hiding the web view container. This maintains the browser
session without closing it. The browser window can be repeatedly hidden and
shown.
** This has only been tested on android and ios **
amazon/android:
An additional
hide
action was added toInAppBrowser#execute
. It isidentical to
show
, except that it callsdialog.hide()
instead.blackberry10:
no changes
firefoxos:
Added a
hide
method that is identical toshow
, indicating it is notsupported.
ios:
Added a
hide
method that is identical toshow
, except that it usesdismissViewControllerAnimated
. It checks the value of_previousStatusBarStyle
. If it is-1
, the method returns with noaction performed. If it is not, it is set to
-1.
ubuntu:
Added a
hide
method that setsCordovaWrapper.global.inappbrowser.visible
tofalse
.windows:
Added a
hide
method that setsbrowserWrap.style.display
tonone
.wp:
Added a
hide
method that is identical toshow
, except that it setsbrowser.Visibility
toVisibility.Collapsed
and setsAppBar.IsVisible
tofalse
.