Skip to content

Instantly share code, notes, and snippets.

@egomez99
Created April 2, 2012 19:53
Show Gist options
  • Save egomez99/2286775 to your computer and use it in GitHub Desktop.
Save egomez99/2286775 to your computer and use it in GitHub Desktop.
Open a new browser window
function viewArticle(url) {
var articleDetails = Ti.UI.createWindow({
backgroundColor:'#fff',
barColor:'#000',
navBarHidden: true,
fullscreen:true
});
var webview = Ti.UI.createWebView({
url: url,
touchEnabled: true,
scalesPageToFit:true
});
//-
webview.onCreateWindow = function(e) {
if (!e.isUserGesture) {
return null;
}
var webWin = Ti.UI.createWindow({
fullscreen: false
});
var newWebView = Ti.UI.createWebView();
webWin.add(newWebView);
webWin.open();
return newWebView;
};
//--
articleDetails.add(webview);
articleDetails.open();
articleDetails.orientationModes=[Titanium.UI.LANDSCAPE_LEFT];
articleDetails.addEventListener('android:back', function (e) {
articleDetails.close();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment