diff options
| author | Teddy Wing | 2012-06-24 13:15:11 -0400 |
|---|---|---|
| committer | Teddy Wing | 2012-06-24 13:15:11 -0400 |
| commit | 5d5cb88e92573fbb679797b5f52e7854e073c35d (patch) | |
| tree | 231bd7d8b9b41c40b00ec40a5e08af0e195e7daa | |
| parent | d3fd7fa82303451954d2562c120153d0df49e7d5 (diff) | |
| download | LikeFeed-5d5cb88e92573fbb679797b5f52e7854e073c35d.tar.bz2 | |
FriendSelector: added Enable/Disable all switch widgets.
| -rw-r--r-- | Resources/friendship/ui/FriendSelector.js | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/Resources/friendship/ui/FriendSelector.js b/Resources/friendship/ui/FriendSelector.js index c225d87..3097689 100644 --- a/Resources/friendship/ui/FriendSelector.js +++ b/Resources/friendship/ui/FriendSelector.js @@ -38,7 +38,10 @@ win.close(); }); - friend_table = Ti.UI.createTableView(); + var friend_table = Ti.UI.createTableView({ + bottom: 44 + }); + var switch_buttons = []; var friends = []; @@ -74,6 +77,7 @@ switch_button.addEventListener("change", function(e) { fs.data.friends[this.SP_uidString].selected = e.value; }); + switch_buttons.push(switch_button); row.add(avatar); row.add(name); @@ -84,6 +88,36 @@ win.add(friend_table); + + var buttonbar = Ti.UI.createButtonBar({ + labels: [{title: 'Enable All'}, {title: 'Disable All'}], + backgroundColor: fs.ui.styles.navBarColour, + width: 240 + }); + var flexSpace = Titanium.UI.createButton({ + systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE + }); + var toolbar = Ti.UI.createToolbar({ + barColor: fs.ui.styles.navBarColour, + bottom: 0, + items: [flexSpace, buttonbar, flexSpace] + }); + + buttonbar.addEventListener('click', function(e) { + if (e.index == 0) { + for (var i = 0; i < switch_buttons.length; i++) { + switch_buttons[i].value = true + } + } + else if (e.index == 1) { + for (var i = 0; i < switch_buttons.length; i++) { + switch_buttons[i].value = false + } + } + }); + + win.add(toolbar); + return win; }; })(); |
