Created
June 9, 2011 14:35
-
-
Save hojberg/1016844 to your computer and use it in GitHub Desktop.
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
// THIS IS A SUPER PRESENTER?! | |
YUI.add("presenters:your_rewards", function (Y) { | |
Y.YourRewardsPresenter = Y.Base.create("YourRewardsPresenter", Y.Presenter, [], { | |
initializer: function (options) { | |
this.yourPlacesPresenter = new Y.YourPlacesPresenter({}); | |
this.yourCashPresenter = new Y.YourCashPresenter({}); | |
this.yourCashPresenter.on("balance loaded", this.renderYourCashTabCount, this); | |
this.yourPlacesPresenter.render(); | |
var P = this; | |
Y.one("#sidebar .your_cash_tab").on("click", function (ev) { | |
ev.preventDefault(); | |
P.yourCashPresenter.render(); | |
}); | |
}, | |
renderYourCashTabCount: function (count) { | |
Y.one(".sometab").append(Y.Node.create("<span class='coun'>" + count + "</span>")); | |
} | |
}, { ATTRS: {} }); | |
}, "1.0.0", {requires: []}); | |
YUI.add("presenters:your_cash", function (Y) { | |
Y.YourCashPresenter = Y.Base.create("YourCashPresenter", Y.Presenter, [], { | |
initializer: function (options) { | |
var P = this; | |
Y.YourCash.getBalance({ | |
succes: function (yourCash) { | |
P.yourCash = yourCash; | |
P.fire("balance loaded"); | |
}, | |
error: function () {} | |
}); | |
}, | |
render: function () { | |
// set up dom stuff and show the right template.. | |
} | |
}, { ATTRS: {} }); | |
}, "1.0.0", {requires: []}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment