Created
June 27, 2012 04:48
-
-
Save ryugoo/3001535 to your computer and use it in GitHub Desktop.
Titanium Mobile 用のうすーーーい TabGroup Wrapper
This file contains 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
class AppTabGroup | |
constructor: (glb = globals) -> | |
@tabGroup = Ti.UI.createTabGroup() | |
@tabGroup.addEventListener "focus", (e) -> | |
glb.currentTab = e.tab | |
return | |
getTabGroup: () -> | |
return @tabGroup | |
appendTab: (param) -> | |
tab = Ti.UI.createTab param | |
@tabGroup[param.tabId] = tab if param.tabId? and typeof param.tabId is "string" | |
@tabGroup.addTab if param.tabId then @tabGroup[param.tabId] else tab | |
return | |
open: (defaultTab = 0) -> | |
@tabGroup.setActiveTab defaultTab | |
@tabGroup.open() | |
return | |
# Modularization | |
module.exports = AppTabGroup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use (CoffeeScript)