not forcing the look of the inAppBrowserWrap and buttons

This commit is contained in:
Piotr Zalewa 2014-04-24 10:51:06 -04:00
parent 88f330abd8
commit 282fdb7a40
2 changed files with 20 additions and 4 deletions

View File

@ -91,6 +91,7 @@ instance, or the system browser.
- Amazon Fire OS - Amazon Fire OS
- Android - Android
- BlackBerry 10 - BlackBerry 10
- Firefox OS
- iOS - iOS
- Windows Phone 7 and 8 - Windows Phone 7 and 8
@ -99,6 +100,23 @@ instance, or the system browser.
var ref = window.open('http://apache.org', '_blank', 'location=yes'); var ref = window.open('http://apache.org', '_blank', 'location=yes');
var ref2 = window.open(encodeURI('http://ja.m.wikipedia.org/wiki/ハングル'), '_blank', 'location=yes'); var ref2 = window.open(encodeURI('http://ja.m.wikipedia.org/wiki/ハングル'), '_blank', 'location=yes');
### Firefox OS Quirks
As plugin doesn't enforce any design there is a need to add some CSS rules if
opened with `target` `'_blank'`. The rules might look like these
``` css
.inappbrowser-wrap {
background-color: rgba(0,0,0,0.75);
color: rgba(235,235,235,1.0);
}
.inappbrowser-wrap p {
padding-top: 10px;
text-align: center;
}
```
## InAppBrowser ## InAppBrowser
The object returned from a call to `window.open`. The object returned from a call to `window.open`.
@ -196,6 +214,7 @@ The function is passed an `InAppBrowserEvent` object.
- Amazon Fire OS - Amazon Fire OS
- Android - Android
- Firefox OS
- iOS - iOS
- Windows Phone 7 and 8 - Windows Phone 7 and 8

View File

@ -63,9 +63,8 @@ var IABExecs = {
document.body.removeChild(browserWrap); document.body.removeChild(browserWrap);
} }
browserWrap = document.createElement('div'); browserWrap = document.createElement('div');
browserWrap.classList.add('inappbrowser-wrap');
browserWrap.style.position = 'absolute'; browserWrap.style.position = 'absolute';
browserWrap.style.backgroundColor = 'rgba(0,0,0,0.75)';
browserWrap.style.color = 'rgba(235,235,235,1.0)';
browserWrap.style.width = window.innerWidth + 'px'; browserWrap.style.width = window.innerWidth + 'px';
browserWrap.style.height = window.innerHeight + 'px'; browserWrap.style.height = window.innerHeight + 'px';
browserWrap.style.padding = '10px,0,0,0'; browserWrap.style.padding = '10px,0,0,0';
@ -83,8 +82,6 @@ var IABExecs = {
var p = document.createElement('p'); var p = document.createElement('p');
p.appendChild(document.createTextNode('close')); p.appendChild(document.createTextNode('close'));
// TODO: make all buttons - ← → × // TODO: make all buttons - ← → ×
p.style.paddingTop = '10px';
p.style.textAlign = 'center';
browserWrap.appendChild(p); browserWrap.appendChild(p);
browserWrap.appendChild(browserElem); browserWrap.appendChild(browserElem);
document.body.appendChild(browserWrap); document.body.appendChild(browserWrap);