diff options
| author | Alexandre Pretto Nunes <anunes@thoughtworks.com> | 2014-08-12 14:09:41 -0300 | 
|---|---|---|
| committer | Alexandre Pretto Nunes <anunes@thoughtworks.com> | 2014-08-12 14:10:02 -0300 | 
| commit | 103180329b3aad65fa816056c2ca2e9f51424507 (patch) | |
| tree | b2251c1446806424266df404e3cfcc979766c52b /web-ui/app/js | |
| parent | fa75c5ddd40d15f1ccbfc593d6f3ab0d50acaf9e (diff) | |
Clean up feature flag mixin
Diffstat (limited to 'web-ui/app/js')
| -rw-r--r-- | web-ui/app/js/mixins/with_feature_toggle.js | 8 | ||||
| -rw-r--r-- | web-ui/app/js/tags/data/tags.js | 24 | 
2 files changed, 17 insertions, 15 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));        }; diff --git a/web-ui/app/js/tags/data/tags.js b/web-ui/app/js/tags/data/tags.js index fc8976c7..f7700430 100644 --- a/web-ui/app/js/tags/data/tags.js +++ b/web-ui/app/js/tags/data/tags.js @@ -5,18 +5,18 @@ define(['flight/lib/component', 'page/events', 'mixins/with_feature_toggle'], fu      $(document).trigger(events.ui.mails.refresh);    })); -      DataTags.all = { -        name: 'all', -        ident: '8752888923742657436', -        query: 'in:all', -        default: true, -        counts:{ -          total:0, -            read:0, -            starred:0, -            replied:0 -        } -      }; +  DataTags.all = { +    name: 'all', +    ident: '8752888923742657436', +    query: 'in:all', +    default: true, +    counts:{ +      total:0, +        read:0, +        starred:0, +        replied:0 +    } +  };    return DataTags;  | 
