From 103180329b3aad65fa816056c2ca2e9f51424507 Mon Sep 17 00:00:00 2001 From: Alexandre Pretto Nunes Date: Tue, 12 Aug 2014 14:09:41 -0300 Subject: Clean up feature flag mixin --- web-ui/app/js/mixins/with_feature_toggle.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'web-ui/app/js/mixins') 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)); }; -- cgit v1.2.3