Created
October 2, 2013 19:36
-
-
Save joefiorini/6799344 to your computer and use it in GitHub Desktop.
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
var Component = Ember.Component.extend({ | |
classNameBindings: [":title", "isFeatured::singlestat"], | |
valueListenerShouldGenerate: false, | |
isFeatured: false, | |
init: function() { | |
var statPoint = this, | |
statId = statPoint.get("stat.id"); | |
this.statDidChange(); | |
this._super(); | |
}, | |
statDidChange: function() { | |
var statId = this.get("stat.id"); | |
var computed = Ember.computed("queue." + statId, function() { | |
return this.get("queue." + statId); | |
}); | |
Ember.defineProperty(this, "_value", computed); | |
this.propertyDidChange("_value"); | |
}.observes("stat"), | |
value: function() { | |
return this.get("_value"); | |
}.property("_value"), | |
label: function() { | |
return this.get("stat.displayName"); | |
}.property("stat.displayName") | |
}); | |
export default Component; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment