Skip to content

Instantly share code, notes, and snippets.

@nazomikan
Created June 1, 2013 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazomikan/5689852 to your computer and use it in GitHub Desktop.
Save nazomikan/5689852 to your computer and use it in GitHub Desktop.
function Window() {
....
}
Window.prototype.build = function () {
this.setWidet();
}
Wondow.prototype.setWidget = function () {
this.root.add(this.widget.tabMenue);
this.root.add(this.widget.screen);
};
//-------------------------------
function Screen() {
}
Screen.prototype.build = function () {
}
Scree.prototype.bindAllListeners = function () {
pubsub.subscribe('screen.change.trigger', proxy(this.changeScene, this));
}
Screen.prototype.changeScene = function (contextPubsub, sceneId) {
this.creanUp();
this.root.add(this.widget.scene[sceneId]);
animate(function () {
contextPubsub.publish('animation.done');
});
}
Screen.prototype.cleanUp = function () {
//screen をきれいにする
};
//-----------------------------
function TabMenu() {
}
TabMenu.prototype.build = function () {
this.bindAllListeners();
}
TabMenu.prototype.bindAllListeners = function () {
}
TabMenu.prototype.setWidget = function () {
this.root.add(this.widget.button1);
}
// -----------------------------
function Button() {
}
Button.prototype.build = function () {
this.bindAllListeners();
}
Button.prototype.bindAllListeners = function () {
this.root.click(proxy(this.onClick, this));
}
Button.prototype.onClick = function () {
var that = this,
sceneId = 1,
conctextPubsub = new Pubsub();
contextPubsub.subscribe('animation.done', function () {
that.changeActive();
})
pubsub.publish('screen.change.trigger', contextPubsub, 1);
}
Button.prototype.changeActive = function () {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment