This commit is contained in:
Jesse MacFadyen 2015-11-17 15:07:20 -08:00
commit 214763c76b

View File

@ -17,13 +17,12 @@
* specific language governing permissions and limitations
* under the License.
*
*/
*/
/*jslint sloppy:true */
/*global Windows:true, require, document, setTimeout, window, module */
var cordova = require('cordova'),
channel = require('cordova/channel');
@ -62,6 +61,7 @@ var IAB = {
browserWrap.style.borderWidth = "40px";
browserWrap.style.borderStyle = "solid";
browserWrap.style.borderColor = "rgba(0,0,0,0.25)";
browserWrap.style.zIndex = "9999999";
browserWrap.onclick = function () {
setTimeout(function () {
@ -71,8 +71,9 @@ var IAB = {
document.body.appendChild(browserWrap);
}
elem = document.createElement("iframe");
var localFile = (strUrl.indexOf('ms-appdata:///') > -1);
if (localFile) {
elem = document.createElement("x-ms-webview");
elem.style.width = (window.innerWidth - 80) + "px";
elem.style.height = (window.innerHeight - 80) + "px";
elem.style.borderWidth = "0px";
@ -86,6 +87,23 @@ var IAB = {
}
});
} else {
elem = document.createElement("iframe");
elem.style.width = (window.innerWidth - 80) + "px";
elem.style.height = (window.innerHeight - 80) + "px";
elem.style.borderWidth = "0px";
elem.name = "targetFrame";
elem.src = strUrl;
window.addEventListener("resize", function () {
if (browserWrap && elem) {
elem.style.width = (window.innerWidth - 80) + "px";
elem.style.height = (window.innerHeight - 80) + "px";
}
});
}
browserWrap.appendChild(elem);
} else {
window.location = strUrl;