diff options
| author | Teddy Wing | 2012-06-23 22:44:13 -0400 |
|---|---|---|
| committer | Teddy Wing | 2012-06-23 22:44:13 -0400 |
| commit | 1bbd391741c2b8826fcb1002b1081b68e6516493 (patch) | |
| tree | 5dbd361c942a8ca057dcb5e09d38eb58944b0eba | |
| parent | c678acdf82f6b3dac4a9fd7bce9f204f8c0afd78 (diff) | |
| download | LikeFeed-1bbd391741c2b8826fcb1002b1081b68e6516493.tar.bz2 | |
Webview: click on a row in the LikeList, and a webview will open.
| -rw-r--r-- | Resources/friendship/ui/ApplicationWindow.js | 2 | ||||
| -rw-r--r-- | Resources/friendship/ui/LikeList.js | 7 | ||||
| -rw-r--r-- | Resources/friendship/ui/WebView.js | 18 | ||||
| -rw-r--r-- | Resources/friendship/ui/ui.js | 3 |
4 files changed, 29 insertions, 1 deletions
diff --git a/Resources/friendship/ui/ApplicationWindow.js b/Resources/friendship/ui/ApplicationWindow.js index ff9a9c3..0211c37 100644 --- a/Resources/friendship/ui/ApplicationWindow.js +++ b/Resources/friendship/ui/ApplicationWindow.js @@ -1,6 +1,8 @@ (function() { fs.ui.createApplicationTabGroup = function() { var tab_group = Ti.UI.createTabGroup(); + Ti.UI.currentTabGroup = tab_group; + var win = Ti.UI.createWindow({ title: 'FriendShip', tabBarHidden: true diff --git a/Resources/friendship/ui/LikeList.js b/Resources/friendship/ui/LikeList.js index 8552b56..54da696 100644 --- a/Resources/friendship/ui/LikeList.js +++ b/Resources/friendship/ui/LikeList.js @@ -2,6 +2,13 @@ fs.ui.createLikeList = function() { var ll_view = Ti.UI.createTableView(); + ll_view.addEventListener('click', function(e) { + Ti.UI.currentTabGroup.activeTab.open(fs.ui.createWebViewWin({ + title: e.title, + url: e.url + })); + }); + return ll_view; }; })(); diff --git a/Resources/friendship/ui/WebView.js b/Resources/friendship/ui/WebView.js new file mode 100644 index 0000000..6b3ad16 --- /dev/null +++ b/Resources/friendship/ui/WebView.js @@ -0,0 +1,18 @@ +(function() { + fs.ui.createWebViewWin = function(_args) { + var options = _args || {} + + var win = Ti.UI.createWindow({ + title: (options['title']) ? options['title'] : '', + backButtonTitle: 'Back' + }); + + var webview = Ti.UI.createWebView({ + url: options['url'] + }); + + win.add(webview); + + return win; + }; +})(); diff --git a/Resources/friendship/ui/ui.js b/Resources/friendship/ui/ui.js index f548cfd..76def2e 100644 --- a/Resources/friendship/ui/ui.js +++ b/Resources/friendship/ui/ui.js @@ -5,5 +5,6 @@ Ti.include( '/friendship/ui/ApplicationWindow.js', '/friendship/ui/LikeList.js', - '/friendship/ui/LoginWindow.js' + '/friendship/ui/LoginWindow.js', + '/friendship/ui/WebView.js' ) |
