Created
April 2, 2012 19:53
-
-
Save egomez99/2286775 to your computer and use it in GitHub Desktop.
Open a new browser window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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