summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mixins
diff options
context:
space:
mode:
authorAlexandre Pretto Nunes <anunes@thoughtworks.com>2014-08-12 14:09:41 -0300
committerAlexandre Pretto Nunes <anunes@thoughtworks.com>2014-08-12 14:10:02 -0300
commit103180329b3aad65fa816056c2ca2e9f51424507 (patch)
treeb2251c1446806424266df404e3cfcc979766c52b /web-ui/app/js/mixins
parentfa75c5ddd40d15f1ccbfc593d6f3ab0d50acaf9e (diff)
Clean up feature flag mixin
Diffstat (limited to 'web-ui/app/js/mixins')
-rw-r--r--web-ui/app/js/mixins/with_feature_toggle.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/web-ui/app/js/mixins/with_feature_toggle.js b/web-ui/app/js/mixins/with_feature_toggle.js
index cf8d0d07..9f4e3759 100644
--- a/web-ui/app/js/mixins/with_feature_toggle.js
+++ b/web-ui/app/js/mixins/with_feature_toggle.js
@@ -4,12 +4,14 @@ define(['features'],
function withFeatureToggle(componentName, behaviorForFeatureOff) {
return function() {
- this.around('initialize', _.bind(function(basicInitialize) {
+ this.around('initialize', _.bind(function(basicInitialize, node, attrs) {
if(features.isEnabled(componentName)) {
- return basicInitialize(arguments[1], arguments[2]);
+ return basicInitialize(node, attrs);
}
else if (behaviorForFeatureOff){
- behaviorForFeatureOff.bind(this).call();
+ behaviorForFeatureOff.call(this);
+
+ return this;
}
}, this));
};